Package dsa.lab01.base
Interface Container<Item>
- Type Parameters:
Item
- the item type
- All Known Subinterfaces:
StaticSequence<Item>
public interface Container<Item>
A container.
Something that contains some number of items, not necessarily in any particular order.
-
Method Summary
-
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
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
-