org.apache.commons.collections15.set
Class AbstractSortedSetDecorator<E>

java.lang.Object
  extended by org.apache.commons.collections15.collection.AbstractCollectionDecorator<E>
      extended by org.apache.commons.collections15.set.AbstractSetDecorator<E>
          extended by org.apache.commons.collections15.set.AbstractSortedSetDecorator<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, Set<E>, SortedSet<E>
Direct Known Subclasses:
UnmodifiableSortedSet

public abstract class AbstractSortedSetDecorator<E>
extends AbstractSetDecorator<E>
implements SortedSet<E>

Decorates another SortedSet to provide additional behaviour.

Methods are forwarded directly to the decorated set.

Since:
Commons Collections 3.0
Version:
$Revision: 1.1 $ $Date: 2005/10/11 17:05:39 $
Author:
Matt Hall, John Watkinson, Stephen Colebourne

Field Summary
 
Fields inherited from class org.apache.commons.collections15.collection.AbstractCollectionDecorator
collection
 
Constructor Summary
protected AbstractSortedSetDecorator()
          Constructor only used in deserialization, do not use otherwise.
protected AbstractSortedSetDecorator(Set<E> set)
          Constructor that wraps (not copies).
 
Method Summary
 Comparator<? super E> comparator()
           
 E first()
           
protected  SortedSet<E> getSortedSet()
          Gets the sorted set being decorated.
 SortedSet<E> headSet(E toElement)
           
 E last()
           
 SortedSet<E> subSet(E fromElement, E toElement)
           
 SortedSet<E> tailSet(E fromElement)
           
 
Methods inherited from class org.apache.commons.collections15.set.AbstractSetDecorator
getSet
 
Methods inherited from class org.apache.commons.collections15.collection.AbstractCollectionDecorator
add, addAll, clear, contains, containsAll, equals, getCollection, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

AbstractSortedSetDecorator

protected AbstractSortedSetDecorator()
Constructor only used in deserialization, do not use otherwise.

Since:
Commons Collections 3.1

AbstractSortedSetDecorator

protected AbstractSortedSetDecorator(Set<E> set)
Constructor that wraps (not copies).

Parameters:
set - the set to decorate, must not be null
Throws:
IllegalArgumentException - if set is null
Method Detail

getSortedSet

protected SortedSet<E> getSortedSet()
Gets the sorted set being decorated.

Returns:
the decorated set

subSet

public SortedSet<E> subSet(E fromElement,
                           E toElement)
Specified by:
subSet in interface SortedSet<E>

headSet

public SortedSet<E> headSet(E toElement)
Specified by:
headSet in interface SortedSet<E>

tailSet

public SortedSet<E> tailSet(E fromElement)
Specified by:
tailSet in interface SortedSet<E>

first

public E first()
Specified by:
first in interface SortedSet<E>

last

public E last()
Specified by:
last in interface SortedSet<E>

comparator

public Comparator<? super E> comparator()
Specified by:
comparator in interface SortedSet<E>


Copyright © 2001-2010 Apache Software Foundation. All Rights Reserved.