|
||||||||||
| 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.jboss.cache.util.ImmutableListCopy<E>
@Immutable public class ImmutableListCopy<E>
A lightweight, read-only copy of a List. Typically used in place of the common idiom:
return Collections.unmodifiableList(new ArrayList( myInternalList ));
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
ImmutableListCopy()
Constructs a new ImmutableListCopy. |
|
ImmutableListCopy(Collection<? extends E> c)
Only one copy constructor since the list is immutable. |
|
ImmutableListCopy(Collection<? extends E> collection1,
Collection<? extends E> collection2)
Utility constructors to allow combining collections |
|
ImmutableListCopy(E[] array)
Assumes that the array passed in is "safe", i.e., is not referenced from elsewhere. |
|
| Method Summary | ||
|---|---|---|
boolean |
add(E o)
|
|
boolean |
addAll(Collection<? extends E> c)
|
|
boolean |
addAll(int index,
Collection<? extends E> c)
|
|
boolean |
contains(Object o)
|
|
E |
get(int index)
|
|
int |
indexOf(Object o)
|
|
boolean |
isEmpty()
|
|
Iterator<E> |
iterator()
|
|
int |
lastIndexOf(Object o)
|
|
ListIterator<E> |
listIterator()
|
|
ListIterator<E> |
listIterator(int index)
|
|
void |
readExternal(ObjectInput in)
See writeExternal(java.io.ObjectOutput) for serialization format |
|
boolean |
remove(Object o)
|
|
boolean |
removeAll(Collection<?> c)
|
|
boolean |
retainAll(Collection<?> c)
|
|
int |
size()
|
|
List<E> |
subList(int fromIndex,
int toIndex)
|
|
Object[] |
toArray()
|
|
|
toArray(T[] a)
|
|
void |
writeExternal(ObjectOutput out)
Format: - entry array size (int) - elements (Object) |
|
| Methods inherited from class java.util.AbstractList |
|---|
add, clear, equals, hashCode, remove, removeRange, set |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll |
| Constructor Detail |
|---|
public ImmutableListCopy()
public ImmutableListCopy(Collection<? extends E> c)
c - collection to copy frompublic ImmutableListCopy(E[] array)
array - to reference
public ImmutableListCopy(Collection<? extends E> collection1,
Collection<? extends E> collection2)
collection1 - collection to copy fromcollection2 - collection to copy from| Method Detail |
|---|
public final int size()
size in interface Collection<E>size in interface List<E>size in class AbstractCollection<E>public final boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface List<E>isEmpty in class AbstractCollection<E>public final boolean contains(Object o)
contains in interface Collection<E>contains in interface List<E>contains in class AbstractCollection<E>public final Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface List<E>iterator in class AbstractList<E>public final Object[] toArray()
toArray in interface Collection<E>toArray in interface List<E>toArray in class AbstractCollection<E>public final <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in interface List<E>toArray in class AbstractCollection<E>public final boolean add(E o)
add in interface Collection<E>add in interface List<E>add in class AbstractList<E>public final boolean remove(Object o)
remove in interface Collection<E>remove in interface List<E>remove in class AbstractCollection<E>public final boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface List<E>addAll in class AbstractCollection<E>
public final boolean addAll(int index,
Collection<? extends E> c)
addAll in interface List<E>addAll in class AbstractList<E>public final boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface List<E>removeAll in class AbstractCollection<E>public final boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>retainAll in interface List<E>retainAll in class AbstractCollection<E>public final E get(int index)
get in interface List<E>get in class AbstractList<E>public final int indexOf(Object o)
indexOf in interface List<E>indexOf in class AbstractList<E>public final int lastIndexOf(Object o)
lastIndexOf in interface List<E>lastIndexOf in class AbstractList<E>public final ListIterator<E> listIterator()
listIterator in interface List<E>listIterator in class AbstractList<E>public final ListIterator<E> listIterator(int index)
listIterator in interface List<E>listIterator in class AbstractList<E>
public final List<E> subList(int fromIndex,
int toIndex)
subList in interface List<E>subList in class AbstractList<E>
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface Externalizableout - stream to write to
IOException
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
writeExternal(java.io.ObjectOutput) for serialization format
readExternal in interface Externalizablein - stream
IOException
ClassNotFoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||