|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.common.collection.ImmutableAppendedList<T>
T
- the type of element@Immutable public class ImmutableAppendedList<T>
An immutable List
that consists of a single element appended to another existing List
. The result is a list
that contains all of the elements in the parent list as well as the last appended element, but while reusing the existing
parent list and without having to create a copy of the parent list.
Constructor Summary | |
---|---|
ImmutableAppendedList(List<T> parent,
T element)
Create an instance using the supplied parent list and an element to be virtually appended to the parent. |
Method Summary | ||
---|---|---|
void |
add(int index,
T element)
|
|
boolean |
add(T o)
|
|
boolean |
addAll(Collection<? extends T> c)
|
|
boolean |
addAll(int index,
Collection<? extends T> c)
|
|
void |
clear()
|
|
boolean |
contains(Object o)
|
|
boolean |
containsAll(Collection<?> c)
|
|
boolean |
equals(Object obj)
|
|
T |
get(int index)
|
|
int |
hashCode()
|
|
int |
indexOf(Object o)
|
|
boolean |
isEmpty()
|
|
Iterator<T> |
iterator()
|
|
int |
lastIndexOf(Object o)
|
|
ListIterator<T> |
listIterator()
|
|
ListIterator<T> |
listIterator(int index)
|
|
T |
remove(int index)
|
|
boolean |
remove(Object o)
|
|
boolean |
removeAll(Collection<?> c)
|
|
boolean |
retainAll(Collection<?> c)
|
|
T |
set(int index,
T element)
|
|
int |
size()
|
|
List<T> |
subList(int fromIndex,
int toIndex)
|
|
Object[] |
toArray()
|
|
|
toArray(X[] a)
|
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ImmutableAppendedList(List<T> parent, T element)
parent
- the parent listelement
- the child element (may be null)
IllegalArgumentException
- if the reference to the parent list is nullMethod Detail |
---|
public boolean contains(Object o)
contains
in interface Collection<T>
contains
in interface List<T>
List.contains(java.lang.Object)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<T>
containsAll
in interface List<T>
List.containsAll(java.util.Collection)
public T get(int index)
get
in interface List<T>
List.get(int)
public int indexOf(Object o)
indexOf
in interface List<T>
List.indexOf(java.lang.Object)
public boolean isEmpty()
isEmpty
in interface Collection<T>
isEmpty
in interface List<T>
List.isEmpty()
public Iterator<T> iterator()
iterator
in interface Iterable<T>
iterator
in interface Collection<T>
iterator
in interface List<T>
List.iterator()
public int lastIndexOf(Object o)
lastIndexOf
in interface List<T>
List.lastIndexOf(java.lang.Object)
public ListIterator<T> listIterator()
listIterator
in interface List<T>
List.listIterator()
public ListIterator<T> listIterator(int index)
listIterator
in interface List<T>
List.listIterator(int)
public int size()
size
in interface Collection<T>
size
in interface List<T>
List.size()
public List<T> subList(int fromIndex, int toIndex)
subList
in interface List<T>
List.subList(int, int)
public Object[] toArray()
toArray
in interface Collection<T>
toArray
in interface List<T>
List.toArray()
public <X> X[] toArray(X[] a)
toArray
in interface Collection<T>
toArray
in interface List<T>
java.util.List#toArray(T[])
public int hashCode()
hashCode
in interface Collection<T>
hashCode
in interface List<T>
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in interface Collection<T>
equals
in interface List<T>
equals
in class Object
Object.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
public void add(int index, T element)
add
in interface List<T>
List.add(int, Object)
public boolean add(T o)
add
in interface Collection<T>
add
in interface List<T>
List.add(Object)
public boolean addAll(Collection<? extends T> c)
addAll
in interface Collection<T>
addAll
in interface List<T>
List.addAll(java.util.Collection)
public boolean addAll(int index, Collection<? extends T> c)
addAll
in interface List<T>
List.addAll(int, java.util.Collection)
public void clear()
clear
in interface Collection<T>
clear
in interface List<T>
List.clear()
public boolean remove(Object o)
remove
in interface Collection<T>
remove
in interface List<T>
List.remove(java.lang.Object)
public T remove(int index)
remove
in interface List<T>
List.remove(int)
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<T>
removeAll
in interface List<T>
List.removeAll(java.util.Collection)
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<T>
retainAll
in interface List<T>
List.retainAll(java.util.Collection)
public T set(int index, T element)
set
in interface List<T>
List.set(int, java.lang.Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |