gausssoft.collections
Class FilterSortedSet

java.lang.Object
  |
  +--gausssoft.collections.FilterSortedSet
All Implemented Interfaces:
Collection, Set, SortedSet

public class FilterSortedSet
extends Object
implements SortedSet

The FilterSortedSet class contains another SortedSet, 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 set.

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

Author:
Allan Crooks
See Also:
SortedSet

Field Summary
protected  SortedSet root
          The backing sorted set.
 
Constructor Summary
FilterSortedSet(SortedSet root)
          Creates a new FilterSortedSet.
 
Method Summary
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 void clear()
           
 Comparator comparator()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection c)
           
 boolean equals(Object o)
           
 Object first()
           
 int hashCode()
           
 SortedSet headSet(Object toElement)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 Object last()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 int size()
           
 SortedSet subSet(Object fromElement, Object toElement)
           
 SortedSet tailSet(Object fromElement)
           
 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 SortedSet root
The backing sorted set.
Constructor Detail

FilterSortedSet

public FilterSortedSet(SortedSet root)
Creates a new FilterSortedSet.
Parameters:
root - The set to wrap this FilterSet around.
Throws:
NullPointerException - root is null.
Method Detail

size

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

isEmpty

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

contains

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

iterator

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

toArray

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

toArray

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

add

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

remove

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

containsAll

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

addAll

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

removeAll

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

retainAll

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

clear

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

equals

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

hashCode

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

comparator

public Comparator comparator()
Specified by:
comparator in interface SortedSet

subSet

public SortedSet subSet(Object fromElement,
                        Object toElement)
Specified by:
subSet in interface SortedSet

headSet

public SortedSet headSet(Object toElement)
Specified by:
headSet in interface SortedSet

tailSet

public SortedSet tailSet(Object fromElement)
Specified by:
tailSet in interface SortedSet

first

public Object first()
Specified by:
first in interface SortedSet

last

public Object last()
Specified by:
last in interface SortedSet

toString

public String toString()
Overrides:
toString in class Object