|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.util.WrapperList<E>
public class WrapperList<E>
List wrapper. Modifiable list that delegates all methods to a wrapped list.
This allows an easy sub-classing. By default, it wraps a thread-safe
Vector instance.
Collections,
List| Constructor Summary | |
|---|---|
WrapperList()
Constructor. |
|
WrapperList(int initialCapacity)
Constructor. |
|
WrapperList(List<E> delegate)
Constructor. |
|
| Method Summary | ||
|---|---|---|
boolean |
add(E element)
Adds a element at the end of the list. |
|
void |
add(int index,
E element)
Inserts the specified element at the specified position in this list. |
|
boolean |
addAll(Collection<? extends E> elements)
Appends all of the elements in the specified collection to the end of this list. |
|
boolean |
addAll(int index,
Collection<? extends E> elements)
Inserts all of the elements in the specified collection into this list at the specified position. |
|
void |
clear()
Removes all of the elements from this list. |
|
boolean |
contains(Object element)
Returns true if this list contains the specified element. |
|
boolean |
containsAll(Collection<?> elements)
Returns true if this list contains all of the elements of the specified collection. |
|
boolean |
equals(Object o)
Compares the specified object with this list for equality. |
|
E |
get(int index)
Returns the element at the specified position in this list. |
|
protected List<E> |
getDelegate()
Returns the delegate list. |
|
int |
hashCode()
Returns the hash code value for this list. |
|
int |
indexOf(Object element)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. |
|
boolean |
isEmpty()
Returns true if this list contains no elements. |
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this list in proper sequence. |
|
int |
lastIndexOf(Object element)
Returns the index in this list of the last occurrence of the specified element, or -1 if this list does not contain this element. |
|
ListIterator<E> |
listIterator()
Returns a list iterator of the elements in this list (in proper sequence). |
|
ListIterator<E> |
listIterator(int index)
Returns a list iterator of the elements in this list (in proper sequence), starting at the specified position in this list. |
|
E |
remove(int index)
Removes the element at the specified position in this list. |
|
boolean |
remove(Object element)
Removes the first occurrence in this list of the specified element. |
|
boolean |
removeAll(Collection<?> elements)
Removes from this list all the elements that are contained in the specified collection. |
|
boolean |
retainAll(Collection<?> elements)
RemovesRetains only the elements in this list that are contained in the specified collection. |
|
E |
set(int index,
E element)
Replaces the element at the specified position in this list with the specified element. |
|
int |
size()
Returns the number of elements in this list. |
|
List<E> |
subList(int fromIndex,
int toIndex)
Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive. |
|
Object[] |
toArray()
Returns an array containing all of the elements in this list in proper sequence. |
|
|
toArray(T[] a)
Returns an array containing all of the elements in this list in proper sequence; the runtime type of the returned array is that of the specified array. |
|
String |
toString()
Returns a string representation of the list. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WrapperList()
public WrapperList(int initialCapacity)
initialCapacity - The initial list capacity.public WrapperList(List<E> delegate)
delegate - The delegate list.| Method Detail |
|---|
public boolean add(E element)
add in interface Collection<E>add in interface List<E>
public void add(int index,
E element)
add in interface List<E>index - The insertion position.element - The element to insert.public boolean addAll(Collection<? extends E> elements)
addAll in interface Collection<E>addAll in interface List<E>elements - The collection of elements to append.
public boolean addAll(int index,
Collection<? extends E> elements)
addAll in interface List<E>index - The insertion position.elements - The collection of elements to insert.public void clear()
clear in interface Collection<E>clear in interface List<E>public boolean contains(Object element)
contains in interface Collection<E>contains in interface List<E>element - The element to find.
public boolean containsAll(Collection<?> elements)
containsAll in interface Collection<E>containsAll in interface List<E>elements - The collection of elements to find.
public boolean equals(Object o)
equals in interface Collection<E>equals in interface List<E>equals in class Objecto - The object to be compared for equality with this list.
public E get(int index)
get in interface List<E>index - The element position.
protected List<E> getDelegate()
public int hashCode()
hashCode in interface Collection<E>hashCode in interface List<E>hashCode in class Objectpublic int indexOf(Object element)
indexOf in interface List<E>element - The element to find.
public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface List<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface List<E>public int lastIndexOf(Object element)
lastIndexOf in interface List<E>public ListIterator<E> listIterator()
listIterator in interface List<E>public ListIterator<E> listIterator(int index)
listIterator in interface List<E>index - The starting position.public E remove(int index)
remove in interface List<E>public boolean remove(Object element)
remove in interface Collection<E>remove in interface List<E>public boolean removeAll(Collection<?> elements)
removeAll in interface Collection<E>removeAll in interface List<E>elements - The collection of element to remove.
public boolean retainAll(Collection<?> elements)
retainAll in interface Collection<E>retainAll in interface List<E>elements - The collection of element to retain.
public E set(int index,
E element)
set in interface List<E>index - The position of the element to replace.element - The new element.public int size()
size in interface Collection<E>size in interface List<E>
public List<E> subList(int fromIndex,
int toIndex)
subList in interface List<E>fromIndex - The start position.toIndex - The end position (exclusive).
public Object[] toArray()
toArray in interface Collection<E>toArray in interface List<E>public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in interface List<E>a - The sample array.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||