gausssoft.collections
Class FilterList

java.lang.Object
  |
  +--gausssoft.collections.FilterList
All Implemented Interfaces:
Collection, List, Serializable

public class FilterList
extends Object
implements List, Serializable

The FilterList class contains another List, which it uses as it's basic source of data, possibly transforming the data along the way or providing additional functionality.

Each method in this implementation calls the method with the same signature in the backing list.

This class can only be serialized if the backing list is serializable.

Author:
Allan Crooks
See Also:
List, Serialized Form

Field Summary
protected  List root
          The backing list.
 
Constructor Summary
FilterList(List root)
          Creates a new FilterList.
 
Method Summary
 void add(int index, Object element)
           
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 boolean addAll(int index, Collection c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection c)
           
 boolean equals(Object o)
           
 Object get(int index)
           
 int hashCode()
           
 int indexOf(Object o)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 int lastIndexOf(Object o)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 Object remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 Object set(int index, Object element)
           
 int size()
           
 List subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
 Object[] toArray(Object[] a)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

root

protected List root
The backing list.
Constructor Detail

FilterList

public FilterList(List root)
Creates a new FilterList.
Parameters:
root - The list to wrap this FilterList around.
Throws:
NullPointerException - root is null.
Method Detail

size

public int size()
Specified by:
size in interface List

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface List

contains

public boolean contains(Object o)
Specified by:
contains in interface List

iterator

public Iterator iterator()
Specified by:
iterator in interface List

toArray

public Object[] toArray()
Specified by:
toArray in interface List

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface List

add

public boolean add(Object o)
Specified by:
add in interface List

remove

public boolean remove(Object o)
Specified by:
remove in interface List

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface List

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface List

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface List

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface List

clear

public void clear()
Specified by:
clear in interface List

equals

public boolean equals(Object o)
Specified by:
equals in interface List
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface List
Overrides:
hashCode in class Object

addAll

public boolean addAll(int index,
                      Collection c)
Specified by:
addAll in interface List

get

public Object get(int index)
Specified by:
get in interface List

set

public Object set(int index,
                  Object element)
Specified by:
set in interface List

add

public void add(int index,
                Object element)
Specified by:
add in interface List

remove

public Object remove(int index)
Specified by:
remove in interface List

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List

listIterator

public ListIterator listIterator()
Specified by:
listIterator in interface List

listIterator

public ListIterator listIterator(int index)
Specified by:
listIterator in interface List

subList

public List subList(int fromIndex,
                    int toIndex)
Specified by:
subList in interface List

toString

public String toString()
Overrides:
toString in class Object