|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.upb.hni.vmagic.util.ForwardingList<E>
E
- the type of the list elementspublic class ForwardingList<E>
Forwarding implementation of the List
interface.
This class is used to easily implement lists which delegate most of its functions
to another list and only change some functions.
Constructor Summary | |
---|---|
ForwardingList(java.util.List<E> list)
Creates a forwarding list. |
Method Summary | ||
---|---|---|
boolean |
add(E e)
Adds an element to this list. |
|
void |
add(int index,
E element)
Adds an element to a specific position in this list. |
|
boolean |
addAll(java.util.Collection<? extends E> c)
Adds all elements of a collection to this list. |
|
boolean |
addAll(int index,
java.util.Collection<? extends E> c)
Adds all elements of a collection to a specific index in this list. |
|
void |
clear()
Clears this list. |
|
boolean |
contains(java.lang.Object o)
Returns if this list contains the given object. |
|
boolean |
containsAll(java.util.Collection<?> c)
Returns if this list contains all elements of thie given collection. |
|
E |
get(int index)
Returns the element at the given index. |
|
int |
indexOf(java.lang.Object o)
Returns the index of the fist occurence of an object. |
|
boolean |
isEmpty()
Returns if this list is empty. |
|
java.util.Iterator<E> |
iterator()
Returns an iterator for this list. |
|
int |
lastIndexOf(java.lang.Object o)
Return the index of the last occurence of an object. |
|
java.util.ListIterator<E> |
listIterator()
Returns a list iterator for this list. |
|
java.util.ListIterator<E> |
listIterator(int index)
Returns a list iterator with a start index. |
|
E |
remove(int index)
Removes the element at a given index. |
|
boolean |
remove(java.lang.Object o)
Removes an object from this list. |
|
boolean |
removeAll(java.util.Collection<?> c)
Removes all elements in a collection from this list. |
|
boolean |
retainAll(java.util.Collection<?> c)
Removes all elements that are not in the given collection from this list. |
|
E |
set(int index,
E element)
Sets the element at the given index. |
|
int |
size()
Returns the size of this list. |
|
java.util.List<E> |
subList(int fromIndex,
int toIndex)
Returns a sub list of this list. |
|
java.lang.Object[] |
toArray()
Converts this list to an array. |
|
|
toArray(T[] a)
Converts this list to an array with a specific type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
equals, hashCode |
Constructor Detail |
---|
public ForwardingList(java.util.List<E> list)
list
- the listMethod Detail |
---|
public int size()
size
in interface java.util.Collection<E>
size
in interface java.util.List<E>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<E>
isEmpty
in interface java.util.List<E>
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection<E>
contains
in interface java.util.List<E>
o
- the object
public java.util.Iterator<E> iterator()
iterator
in interface java.lang.Iterable<E>
iterator
in interface java.util.Collection<E>
iterator
in interface java.util.List<E>
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<E>
toArray
in interface java.util.List<E>
public <T> T[] toArray(T[] a)
toArray
in interface java.util.Collection<E>
toArray
in interface java.util.List<E>
T
- the typea
- the array
public boolean add(E e)
add
in interface java.util.Collection<E>
add
in interface java.util.List<E>
e
- the element
true
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection<E>
remove
in interface java.util.List<E>
o
- the object
true
, if the object was removedpublic boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<E>
containsAll
in interface java.util.List<E>
c
- the collection
true
, if the list contains all elementspublic boolean addAll(java.util.Collection<? extends E> c)
addAll
in interface java.util.Collection<E>
addAll
in interface java.util.List<E>
c
- the collection
true
, if this list was changedpublic boolean addAll(int index, java.util.Collection<? extends E> c)
addAll
in interface java.util.List<E>
index
- the indexc
- the collection
true
, if this list was changedpublic boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<E>
removeAll
in interface java.util.List<E>
c
- the collection
true
, if this list was changedpublic boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<E>
retainAll
in interface java.util.List<E>
c
- the collection
true
, if this list was changedpublic void clear()
clear
in interface java.util.Collection<E>
clear
in interface java.util.List<E>
public E get(int index)
get
in interface java.util.List<E>
index
- the index
public E set(int index, E element)
set
in interface java.util.List<E>
index
- the indexelement
- the new element
public void add(int index, E element)
add
in interface java.util.List<E>
index
- the indexelement
- the elementpublic E remove(int index)
remove
in interface java.util.List<E>
index
- the index
public int indexOf(java.lang.Object o)
indexOf
in interface java.util.List<E>
o
- the object
public int lastIndexOf(java.lang.Object o)
lastIndexOf
in interface java.util.List<E>
o
- the object
public java.util.ListIterator<E> listIterator()
listIterator
in interface java.util.List<E>
public java.util.ListIterator<E> listIterator(int index)
listIterator
in interface java.util.List<E>
index
- the index
public java.util.List<E> subList(int fromIndex, int toIndex)
subList
in interface java.util.List<E>
fromIndex
- the first indextoIndex
- the last index
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |