Interface Container<Item>

Type Parameters:
Item - the item type
All Known Subinterfaces:
StaticSequence<Item>
All Known Implementing Classes:
Array, Array

public interface Container<Item>
A container.

Something that contains some number of items, not necessarily in any particular order.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(Item item)
    Check if the given item is equal to any of those contained.
    default boolean
    Check if it's empty.
    int
    Get the number of contained items.
  • Method Details

    • size

      int size()
      Get the number of contained items.
      Returns:
      the size
    • isEmpty

      default boolean isEmpty()
      Check if it's empty.
      Returns:
      whether there are no items
    • contains

      boolean contains(Item item)
      Check if the given item is equal to any of those contained.
      Parameters:
      item - the item to check for membership
      Returns:
      whether such an item is contained