org.jfree.layouting.util

Class ObjectList

public class ObjectList extends AbstractObjectList

A list of objects that can grow as required.

When cloning, the objects in the list are NOT cloned, only the references.

Author: Thomas Morgner

Constructor Summary
ObjectList()
Default constructor.
ObjectList(int initialCapacity)
Creates a new list.
Method Summary
Objectget(int index)
Returns the object at the specified index, if there is one, or null.
intindexOf(Object object)
Returns the index of the specified object, or -1 if the object is not in the list.
voidset(int index, Object object)
Sets an object reference (overwriting any existing object).

Constructor Detail

ObjectList

public ObjectList()
Default constructor.

ObjectList

public ObjectList(int initialCapacity)
Creates a new list.

Parameters: initialCapacity the initial capacity.

Method Detail

get

public Object get(int index)
Returns the object at the specified index, if there is one, or null.

Parameters: index the object index.

Returns: The object or null.

indexOf

public int indexOf(Object object)
Returns the index of the specified object, or -1 if the object is not in the list.

Parameters: object the object.

Returns: The index or -1.

set

public void set(int index, Object object)
Sets an object reference (overwriting any existing object).

Parameters: index the object index. object the object (null permitted).