Interface Container<T>

Type Parameters:
T - Type of the items in this container
All Superinterfaces:
Iterable<T>
All Known Implementing Classes:
SystemGroup

public interface Container<T> extends Iterable<T>
Represents an abstract container with items.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(T item)
    Adds an item to this container.
    void
    Removes all items from this container.
    boolean
     
    int
     

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • add

      boolean add(T item)
      Adds an item to this container.
      Parameters:
      item - Item to add to this container
      Returns:
      True if the container changed after adding the item
    • clear

      void clear()
      Removes all items from this container.
    • isEmpty

      boolean isEmpty()
      Returns:
      True if this container has no items.
    • size

      int size()
      Returns:
      The amount of items in this container.