Class TransformedNavigableSet<E>
- java.lang.Object
-
- org.apache.commons.collections4.collection.AbstractCollectionDecorator<E>
-
- org.apache.commons.collections4.collection.TransformedCollection<E>
-
- org.apache.commons.collections4.set.TransformedSet<E>
-
- org.apache.commons.collections4.set.TransformedSortedSet<E>
-
- org.apache.commons.collections4.set.TransformedNavigableSet<E>
-
- Type Parameters:
E
- the type of the elements in this set
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.NavigableSet<E>
,java.util.Set<E>
,java.util.SortedSet<E>
public class TransformedNavigableSet<E> extends TransformedSortedSet<E> implements java.util.NavigableSet<E>
Decorates anotherNavigableSet
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.
- Since:
- 4.1
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description E
ceiling(E e)
java.util.Iterator<E>
descendingIterator()
java.util.NavigableSet<E>
descendingSet()
E
floor(E e)
java.util.NavigableSet<E>
headSet(E toElement, boolean inclusive)
E
higher(E e)
E
lower(E e)
E
pollFirst()
E
pollLast()
java.util.NavigableSet<E>
subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
java.util.NavigableSet<E>
tailSet(E fromElement, boolean inclusive)
static <E> TransformedNavigableSet<E>
transformedNavigableSet(java.util.NavigableSet<E> set, Transformer<? super E,? extends E> transformer)
Factory method to create a transforming navigable set that will transform existing contents of the specified navigable set.static <E> TransformedNavigableSet<E>
transformingNavigableSet(java.util.NavigableSet<E> set, Transformer<? super E,? extends E> transformer)
Factory method to create a transforming navigable set.-
Methods inherited from class org.apache.commons.collections4.set.TransformedSortedSet
comparator, first, headSet, last, subSet, tailSet, transformedSortedSet, transformingSortedSet
-
Methods inherited from class org.apache.commons.collections4.set.TransformedSet
equals, hashCode, transformedSet, transformingSet
-
Methods inherited from class org.apache.commons.collections4.collection.TransformedCollection
add, addAll, transformedCollection, transformingCollection
-
Methods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator
clear, contains, containsAll, isEmpty, iterator, remove, removeAll, removeIf, retainAll, size, toArray, toArray, toString
-
-
-
-
Method Detail
-
transformingNavigableSet
public static <E> TransformedNavigableSet<E> transformingNavigableSet(java.util.NavigableSet<E> set, Transformer<? super E,? extends E> transformer)
Factory method to create a transforming navigable set.If there are any elements already in the set being decorated, they are NOT transformed. Contrast this with
transformedNavigableSet(NavigableSet, Transformer)
.- Type Parameters:
E
- the element type- Parameters:
set
- the set to decorate, must not be nulltransformer
- the transformer to use for conversion, must not be null- Returns:
- a new transformed
NavigableSet
- Throws:
java.lang.NullPointerException
- if set or transformer is null
-
transformedNavigableSet
public static <E> TransformedNavigableSet<E> transformedNavigableSet(java.util.NavigableSet<E> set, Transformer<? super E,? extends E> transformer)
Factory method to create a transforming navigable set that will transform existing contents of the specified navigable set.If there are any elements already in the set being decorated, they will be transformed by this method. Contrast this with
transformingNavigableSet(NavigableSet, Transformer)
.- Type Parameters:
E
- the element type- Parameters:
set
- the set to decorate, must not be nulltransformer
- the transformer to use for conversion, must not be null- Returns:
- a new transformed
NavigableSet
- Throws:
java.lang.NullPointerException
- if set or transformer is null
-
descendingSet
public java.util.NavigableSet<E> descendingSet()
- Specified by:
descendingSet
in interfacejava.util.NavigableSet<E>
-
descendingIterator
public java.util.Iterator<E> descendingIterator()
- Specified by:
descendingIterator
in interfacejava.util.NavigableSet<E>
-
subSet
public java.util.NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
- Specified by:
subSet
in interfacejava.util.NavigableSet<E>
-
headSet
public java.util.NavigableSet<E> headSet(E toElement, boolean inclusive)
- Specified by:
headSet
in interfacejava.util.NavigableSet<E>
-
-