SortedSet to transform objects that are added.
The add methods are affected by this class. Thus objects must be removed or searched for using their transformed form. For example, if the transformation converts Strings to Integers, you must use the Integer form to remove objects.
This class is Serializable from Commons Collections 3.1.
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
Hides org. |
| Access | Constructor and Description |
|---|---|
| protected | TransformedSortedSet(final SortedSet<E>
the set to decorate, must not be null set, final Transformer<? super E, ? extends E> the transformer to use for conversion, must not be null transformer)Constructor that wraps (not copies). |
| Modifier and Type | Method and Description |
|---|---|
| public Comparator | comparator()
Implements java. null if this set uses the natural ordering of its elements.
|
| public E | first()
Implements java. |
| protected SortedSet | |
| public SortedSet | headSet(final E
high endpoint (exclusive) of the returned set toElement)Implements java. toElement.
|
| public E | last()
Implements java. |
| public SortedSet | subSet(final E
low endpoint (inclusive) of the returned set fromElement, final E high endpoint (exclusive) of the returned set toElement)Implements java. fromElement, inclusive, to toElement,
exclusive.
|
| public SortedSet | tailSet(final E
low endpoint (inclusive) of the returned set fromElement)Implements java. fromElement.
|
| public static < the element type E> TransformedSortedSet | Returns: a new transformedSortedSetthe set to decorate, must not be null set, final Transformer<? super E, ? extends E> the transformer to use for conversion, must not be null transformer)Factory method to create a transforming sorted set that will transform existing contents of the specified sorted set. |
| public static < the element type E> TransformedSortedSet | Returns: a new transformedSortedSetthe set to decorate, must not be null set, final Transformer<? super E, ? extends E> the transformer to use for conversion, must not be null transformer)Factory method to create a transforming sorted set. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides org. Serialization version | |
| TransformedSortedSet | back to summary |
|---|---|
| protected TransformedSortedSet(final SortedSet<E> set, final Transformer<? super E, ? extends E> transformer) Constructor that wraps (not copies). If there are any elements already in the set being decorated, they are NOT transformed.
| |
| comparator | back to summary |
|---|---|
| public Comparator Implements java. Doc from java. Returns the comparator used to order the elements in this set,
or
| |
| first | back to summary |
|---|---|
| public E first() Implements java. Doc from java. Returns the first (lowest) element currently in this set.
| |
| getSortedSet | back to summary |
|---|---|
| protected SortedSet Gets the decorated set.
| |
| headSet | back to summary |
|---|---|
| public SortedSet Implements java. Doc from java. Returns a view of the portion of this set whose elements are
strictly less than The returned set will throw an | |
| last | back to summary |
|---|---|
| public E last() Implements java. Doc from java. Returns the last (highest) element currently in this set.
| |
| subSet | back to summary |
|---|---|
| public SortedSet Implements java. Doc from java. Returns a view of the portion of this set whose elements range
from The returned set will throw an | |
| tailSet | back to summary |
|---|---|
| public SortedSet Implements java. Doc from java. Returns a view of the portion of this set whose elements are
greater than or equal to The returned set will throw an | |
| transformedSortedSet | back to summary |
|---|---|
| public static <E> TransformedSortedSet Factory method to create a transforming sorted set that will transform existing contents of the specified sorted set.
If there are any elements already in the set being decorated, they
will be transformed by this method.
Contrast this with
| |
| transformingSortedSet | back to summary |
|---|---|
| public static <E> TransformedSortedSet Factory method to create a transforming sorted set.
If there are any elements already in the set being decorated, they
are NOT transformed.
Contrast this with
| |