Package org.jfree.chart.util
Class AbstractObjectList
java.lang.Object
org.jfree.chart.util.AbstractObjectList
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
BooleanList,ObjectList,PaintList,ShapeList,StrokeList
A list of objects that can grow as required.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default initial capacity of the list. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a new list with the default initial capacity.protectedAbstractObjectList(int initialCapacity) Creates a new list.protectedAbstractObjectList(int initialCapacity, int increment) Creates a new list. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the list.clone()Clones the list of objects.booleanTests this list for equality with another object.protected Objectget(int index) Returns the object at the specified index, if there is one, ornull.inthashCode()Returns a hash code value for the object.protected intReturns the index of the specified object, or -1 if the object is not in the list.protected voidSets an object reference (overwriting any existing object).intsize()Returns the size of the list.
-
Field Details
-
DEFAULT_INITIAL_CAPACITY
The default initial capacity of the list.- See Also:
-
-
Constructor Details
-
AbstractObjectList
protected AbstractObjectList()Creates a new list with the default initial capacity. -
AbstractObjectList
Creates a new list.- Parameters:
initialCapacity- the initial capacity.
-
AbstractObjectList
Creates a new list.- Parameters:
initialCapacity- the initial capacity.increment- the increment.
-
-
Method Details
-
get
Returns the object at the specified index, if there is one, ornull.- Parameters:
index- the object index.- Returns:
- The object or
null.
-
set
Sets an object reference (overwriting any existing object).- Parameters:
index- the object index.object- the object (nullpermitted).
-
clear
Clears the list. -
size
Returns the size of the list.- Returns:
- The size of the list.
-
indexOf
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.
-
equals
Tests this list for equality with another object. -
hashCode
Returns a hash code value for the object. -
clone
Clones the list of objects. The objects in the list are not cloned, so this is method makes a 'shallow' copy of the list.- Overrides:
clonein classObject- Returns:
- A clone.
- Throws:
CloneNotSupportedException- if an item in the list does not support cloning.
-