net.sf.molae.pipe.basic
Class ListProxy<B extends List<E>,E>

java.lang.Object
  extended by net.sf.molae.pipe.basic.ObjectProxy<B>
      extended by net.sf.molae.pipe.basic.CollectionProxy<B,E>
          extended by 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.
 
Method Summary
 void add(int index, E element)
           
 boolean addAll(int index, Collection<? extends E> c)
           
 boolean equals(Object o)
          Indicates whether some other object is "equal to" this one.
 E get(int index)
           
 int indexOf(Object element)
           
 int lastIndexOf(Object element)
           
 ListIterator<E> listIterator()
           
 ListIterator<E> listIterator(int index)
           
 E remove(int index)
           
 E set(int index, E element)
           
 List<E> subList(int fromIndex, int toIndex)
           
 
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 class net.sf.molae.pipe.basic.ObjectProxy
assertNotNull, getBase, hashCode, toString, toVerboseString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, addAll, clear, contains, containsAll, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

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.
Method Detail

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:
  1. The object is not null.
  2. The classes of this and the other object are equal.
  3. 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>