All Packages Class Hierarchy This Package Previous Next Index
Class busrider.ItemCollection
java.lang.Object
|
+----busrider.ItemCollection
- public class ItemCollection
- extends Object
This class represents a collection of Items.
- See Also:
- Item
Constructor Index
-
ItemCollection()
- constructs an empty collection.
Method Index
-
append(Item)
- adds the Item to the collection.
-
findName(String)
- returns the Item with the given name, or null if there isn't one.
-
getItem(int)
- returns the
idx
'th element of the collection.
-
getQuan()
- returns the number of objects in the collection.
Constructors
ItemCollection
public ItemCollection()
- constructs an empty collection.
Methods
getQuan
public int getQuan()
- returns the number of objects in the collection.
getItem
public Item getItem(int idx)
- returns the
idx
'th element of the collection.
findName
public Item findName(String name)
- returns the Item with the given name, or null if there isn't one.
append
public boolean append(Item it)
- adds the Item to the collection.
But first, it checks for an equivalent name, and doesn't add if
found.
The return value indicates whether the item was added.
All Packages Class Hierarchy This Package Previous Next Index