public class ItemList extends Object
List| Constructor and Description |
|---|
ItemList()
Creates a new
ItemList. |
ItemList(boolean setType)
Creates a new
ItemList. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Collection items)
Adds a list of items to the list or set.
|
protected void |
addItem(Object value)
Adds an item to the list.
|
Collection |
get()
Gets the list of items as a collection.
|
protected Object |
getItem(int index)
Gets the item at the specified index as an
Object. |
int |
getSize()
Gets the number of items included in the list.
|
public ItemList()
ItemList.
The list will be able to contain several instances of an object.public ItemList(boolean setType)
ItemList.setType - if true an object can be added only once in the list,
if false an object can be added several times in the list.public final void add(Collection items) throws IllegalArgumentException
items - the collection of items to add in the list, cannot be null.IllegalArgumentException - if items == null.public final Collection get()
java.util.Set or a java.util.List is returned
depending on the type of this list.null.
the collection returned cannot be modified.protected final void addItem(Object value) throws IllegalArgumentException
value - the value of the item to add in the list, cannot be null.IllegalArgumentException - if value == null.protected final Object getItem(int index)
Object.index - the position of the required item, it should be >= 0 and < getSize().null.public int getSize()
See http://www.xins.org/.