- Type Parameters:
- Item- the item type
- All Implemented Interfaces:
- Container<Item>
An array-based container.
 
 Contains some number of items using an array.
- 
Constructor SummaryConstructors 
Construct an empty array. 
 
Construct an array containing the given items. 
 
 
- 
Method Summary
boolean
 
Check if the given item is equal to any of those contained. 
 int
 
Get the number of contained items. 
 
 
 
 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
- 
Constructor Details
- 
Arraypublic Array() Construct an empty array. 
- 
ArrayConstruct an array containing the given items. 
- Parameters:
- items- the items
 
 
- 
Method Details
- 
sizepublic int size() Get the number of contained items. 
- Specified by:
- sizein interface- Container<Item>
- Returns:
- the size
 
- 
containspublic boolean contains(Item item) Check if the given item is equal to any of those contained. 
- Specified by:
- containsin interface- Container<Item>
- Parameters:
- item- the item to check for membership
- Returns:
- whether such an item is contained