| java.util.ArrayList org.geotools.util.CheckedArrayList
CheckedArrayList | public class CheckedArrayList extends ArrayList implements CheckedCollection,Cloneable(Code) | | Acts as a typed
java.util.List while we wait for Java 5.0.
since: 2.1 version: $Id: CheckedArrayList.java 25193 2007-04-18 13:37:38Z desruisseaux $ author: Jody Garnett (Refractions Research) author: Martin Desruisseaux MetadataEntity.unmodifiable(Object) |
Method Summary | |
public boolean | add(Object element) Appends the specified element to the end of this list.
Parameters: element - element to be appended to this list. | public void | add(int index, Object element) Inserts the specified element at the specified position in this list. | public boolean | addAll(Collection collection) Appends all of the elements in the specified collection to the end of this list,
in the order that they are returned by the specified Collection's Iterator.
Parameters: collection - the elements to be inserted into this list. | public boolean | addAll(int index, Collection collection) Inserts all of the elements in the specified collection into this list,
starting at the specified position.
Parameters: index - index at which to insert first element fromm the specified collection. Parameters: collection - elements to be inserted into this list. | protected void | ensureValidType(Object element) Checks the type of the specified object. | public Class | getElementType() Returns the element type given at construction time. | public Object | set(int index, Object element) Replaces the element at the specified position in this list with the specified element.
Parameters: index - index of element to replace. Parameters: element - element to be stored at the specified position. |
CheckedArrayList | public CheckedArrayList(Class type)(Code) | | Constructs a list of the specified type.
Parameters: type - The element type (should not be null). |
CheckedArrayList | public CheckedArrayList(Class type, int capacity)(Code) | | Constructs a list of the specified type and initial capacity.
Parameters: type - The element type (should not be null). Parameters: capacity - The initial capacity. since: 2.4 |
add | public boolean add(Object element)(Code) | | Appends the specified element to the end of this list.
Parameters: element - element to be appended to this list. always true . throws: IllegalArgumentException - if the specified element is not of the expected type. |
add | public void add(int index, Object element)(Code) | | Inserts the specified element at the specified position in this list.
Parameters: index - index at which the specified element is to be inserted. Parameters: element - element to be inserted. throws: IndexOutOfBoundsException - if index out of range. throws: IllegalArgumentException - if the specified element is not of the expected type. |
addAll | public boolean addAll(Collection collection)(Code) | | Appends all of the elements in the specified collection to the end of this list,
in the order that they are returned by the specified Collection's Iterator.
Parameters: collection - the elements to be inserted into this list. true if this list changed as a result of the call. throws: IllegalArgumentException - if at least one element is not of the expected type. |
addAll | public boolean addAll(int index, Collection collection)(Code) | | Inserts all of the elements in the specified collection into this list,
starting at the specified position.
Parameters: index - index at which to insert first element fromm the specified collection. Parameters: collection - elements to be inserted into this list. true if this list changed as a result of the call. throws: IllegalArgumentException - if at least one element is not of the expected type. |
ensureValidType | protected void ensureValidType(Object element) throws IllegalArgumentException(Code) | | Checks the type of the specified object. The default implementation ensure
that the object is assignable to the type specified at construction time.
Parameters: element - the object to check, or null . throws: IllegalArgumentException - if the specified element is not of the expected type. |
getElementType | public Class getElementType()(Code) | | Returns the element type given at construction time.
since: 2.4 |
set | public Object set(int index, Object element)(Code) | | Replaces the element at the specified position in this list with the specified element.
Parameters: index - index of element to replace. Parameters: element - element to be stored at the specified position. the element previously at the specified position. throws: IndexOutOfBoundsException - if index out of range. throws: IllegalArgumentException - if the specified element is not of the expected type. |
|
|