java.io.Serializable
, java.lang.Cloneable
public class ObjectList extends AbstractObjectList
When cloning, the objects in the list are NOT cloned, only the references.
DEFAULT_INITIAL_CAPACITY
Constructor | Description |
---|---|
ObjectList() |
Default constructor.
|
ObjectList(int initialCapacity) |
Creates a new list.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
get(int index) |
Returns the object at the specified index, if there is one, or
null . |
int |
indexOf(java.lang.Object object) |
Returns the index of the specified object, or -1 if the object is not in the list.
|
void |
set(int index,
java.lang.Object object) |
Sets an object reference (overwriting any existing object).
|
public ObjectList()
public ObjectList(int initialCapacity)
initialCapacity
- the initial capacity.public java.lang.Object get(int index)
null
.get
in class AbstractObjectList
index
- the object index.null
.public void set(int index, java.lang.Object object)
set
in class AbstractObjectList
index
- the object index.object
- the object (null
permitted).public int indexOf(java.lang.Object object)
indexOf
in class AbstractObjectList
object
- the object.