net.sf.molae.pipe.basic
Class ListProxy<B extends List<E>,E>
java.lang.Object
net.sf.molae.pipe.basic.ObjectProxy<B>
net.sf.molae.pipe.basic.CollectionProxy<B,E>
net.sf.molae.pipe.basic.ListProxy<B,E>
- All Implemented Interfaces:
- Iterable<E>, Collection<E>, List<E>
- Direct Known Subclasses:
- CorrectList
public class ListProxy<B extends List<E>,E>
- extends CollectionProxy<B,E>
- implements List<E>
Delegates all method calls to another list.
Useful base class for list wrapper implementations.
|
Constructor Summary |
ListProxy(B base)
Constructs a new proxy of the specified object. |
| Methods inherited from class net.sf.molae.pipe.basic.CollectionProxy |
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Methods inherited from interface java.util.List |
add, addAll, clear, contains, containsAll, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
ListProxy
public ListProxy(B base)
- Constructs a new proxy of the specified object.
- Parameters:
base - the underlying object.
- Throws:
NullPointerException - if the specified object is
null.
equals
public boolean equals(Object o)
- Description copied from class:
ObjectProxy
- Indicates whether some other object is "equal to" this one.
This implementation checks three conditions:
- The object is not
null.
- The classes of this and the other object are equal.
- The base objects are equal.
- Specified by:
equals in interface Collection<E>- Specified by:
equals in interface List<E>- Overrides:
equals in class ObjectProxy<B extends List<E>>
- Parameters:
o - the reference object with which to compare
- Returns:
true if this object equals the specified object.
addAll
public boolean addAll(int index,
Collection<? extends E> c)
- Specified by:
addAll in interface List<E>
get
public E get(int index)
- Specified by:
get in interface List<E>
set
public E set(int index,
E element)
- Specified by:
set in interface List<E>
add
public void add(int index,
E element)
- Specified by:
add in interface List<E>
remove
public E remove(int index)
- Specified by:
remove in interface List<E>
indexOf
public int indexOf(Object element)
- Specified by:
indexOf in interface List<E>
lastIndexOf
public int lastIndexOf(Object element)
- Specified by:
lastIndexOf in interface List<E>
listIterator
public ListIterator<E> listIterator()
- Specified by:
listIterator in interface List<E>
listIterator
public ListIterator<E> listIterator(int index)
- Specified by:
listIterator in interface List<E>
subList
public List<E> subList(int fromIndex,
int toIndex)
- Specified by:
subList in interface List<E>