|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
org.geotools.resources.UnmodifiableArrayList<E>
E
- The type of elements in the list.public class UnmodifiableArrayList<E>
An unmodifiable view of an array. Invoking
UnmodifiableArrayList.wrap(array);
is equivalent to
Collections.unmodifiableList(Arrays.asList(array)));
But this class provides a very slight performance improvement since it uses one less level
of indirection.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
protected |
UnmodifiableArrayList(E[] array)
Creates a new instance of an array list. |
Method Summary | ||
---|---|---|
boolean |
contains(java.lang.Object object)
Returns true if this collection contains the specified element. |
|
E |
get(int index)
Returns the element at the specified index. |
|
java.lang.Class<E> |
getElementType()
Returns the element type of the wrapped array. |
|
int |
indexOf(java.lang.Object object)
Returns the index in this list of the first occurence of the specified element, or -1 if the list does not contain this element. |
|
int |
lastIndexOf(java.lang.Object object)
Returns the index in this list of the last occurence of the specified element, or -1 if the list does not contain this element. |
|
int |
size()
Returns the list size. |
|
static
|
wrap(E[] array)
Creates a new instance of an array list. |
Methods inherited from class java.util.AbstractList |
---|
add, add, addAll, clear, equals, hashCode, iterator, listIterator, listIterator, remove, removeRange, set, subList |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
add, addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray |
Methods inherited from interface java.util.List |
---|
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Constructor Detail |
---|
protected UnmodifiableArrayList(E[] array)
This constructor is for subclassing only. Users should invoke the wrap(E[])
static
factory method, which provides more convenient handling of parameterized types.
array
- The array to wrap.Method Detail |
---|
public static <E> UnmodifiableArrayList<E> wrap(E[] array)
E
- The type of elements in the list.array
- The array to wrap.
public java.lang.Class<E> getElementType()
getElementType
in interface CheckedCollection<E>
public int size()
size
in interface java.util.Collection<E>
size
in interface java.util.List<E>
size
in class java.util.AbstractCollection<E>
public E get(int index)
get
in interface java.util.List<E>
get
in class java.util.AbstractList<E>
public int indexOf(java.lang.Object object)
indexOf
in interface java.util.List<E>
indexOf
in class java.util.AbstractList<E>
object
- The element to search for.public int lastIndexOf(java.lang.Object object)
lastIndexOf
in interface java.util.List<E>
lastIndexOf
in class java.util.AbstractList<E>
object
- The element to searcch for.public boolean contains(java.lang.Object object)
true
if this collection contains the specified element.
This method is overridden only for performance reason (the default implementation
would work as well).
contains
in interface java.util.Collection<E>
contains
in interface java.util.List<E>
contains
in class java.util.AbstractCollection<E>
object
- The element to check for existence.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |