org.xins.common.types
Class ItemList

java.lang.Object
  extended byorg.xins.common.types.ItemList
Direct Known Subclasses:
List.Value, Set.Value

public class ItemList
extends Object

Item in a list or a set type.

Since:
XINS 1.0.0
Version:
$Revision: 1.10 $ $Date: 2006/08/28 09:12:34 $
Author:
Anthony Goubard
See Also:
List

Constructor Summary
ItemList()
          Creates a new ItemList.
ItemList(boolean setType)
          Creates a new ItemList.
 
Method Summary
protected  void addItem(Object value)
          Adds an item to the list.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemList

public ItemList()
Creates a new ItemList. The list will be able to contain several instances of an object.


ItemList

public ItemList(boolean setType)
Creates a new ItemList.

Parameters:
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.
Method Detail

addItem

protected final void addItem(Object value)
                      throws IllegalArgumentException
Adds an item to the list. The item is added at the end of the list.

Parameters:
value - the value of the item to add in the list, cannot be null.
Throws:
IllegalArgumentException - if value == null.

getItem

protected final Object getItem(int index)
Gets the item at the specified index as an Object.

Parameters:
index - the position of the required item, it should be >= 0 and < getSize().
Returns:
the item, not null.

getSize

public int getSize()
Gets the number of items included in the list.

Returns:
the size of the list.


See http://www.xins.org/.