Class AbstractSortedSetDecorator<E>
- java.lang.Object
-
- org.apache.commons.collections4.collection.AbstractCollectionDecorator<E>
-
- org.apache.commons.collections4.set.AbstractSetDecorator<E>
-
- org.apache.commons.collections4.set.AbstractSortedSetDecorator<E>
-
- Type Parameters:
E
- the type of the elements in the sorted set
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
,java.util.SortedSet<E>
- Direct Known Subclasses:
AbstractNavigableSetDecorator
,UnmodifiableSortedSet
public abstract class AbstractSortedSetDecorator<E> extends AbstractSetDecorator<E> implements java.util.SortedSet<E>
Decorates anotherSortedSet
to provide additional behaviour.Methods are forwarded directly to the decorated set.
- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
Serialization version
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSortedSetDecorator()
Constructor only used in deserialization, do not use otherwise.protected
AbstractSortedSetDecorator(java.util.Set<E> set)
Constructor that wraps (not copies).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Comparator<? super E>
comparator()
protected java.util.SortedSet<E>
decorated()
Gets the set being decorated.E
first()
java.util.SortedSet<E>
headSet(E toElement)
E
last()
java.util.SortedSet<E>
subSet(E fromElement, E toElement)
java.util.SortedSet<E>
tailSet(E fromElement)
-
Methods inherited from class org.apache.commons.collections4.set.AbstractSetDecorator
equals, hashCode
-
Methods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, removeIf, retainAll, setCollection, size, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serialization version- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractSortedSetDecorator
protected AbstractSortedSetDecorator()
Constructor only used in deserialization, do not use otherwise.- Since:
- 3.1
-
AbstractSortedSetDecorator
protected AbstractSortedSetDecorator(java.util.Set<E> set)
Constructor that wraps (not copies).- Parameters:
set
- the set to decorate, must not be null- Throws:
java.lang.NullPointerException
- if set is null
-
-
Method Detail
-
decorated
protected java.util.SortedSet<E> decorated()
Gets the set being decorated.- Overrides:
decorated
in classAbstractSetDecorator<E>
- Returns:
- the decorated set
-
subSet
public java.util.SortedSet<E> subSet(E fromElement, E toElement)
- Specified by:
subSet
in interfacejava.util.SortedSet<E>
-
headSet
public java.util.SortedSet<E> headSet(E toElement)
- Specified by:
headSet
in interfacejava.util.SortedSet<E>
-
tailSet
public java.util.SortedSet<E> tailSet(E fromElement)
- Specified by:
tailSet
in interfacejava.util.SortedSet<E>
-
-