Class PredicatedNavigableSet<E>
java.lang.Object
org.apache.commons.collections4.collection.AbstractCollectionDecorator<E>
org.apache.commons.collections4.collection.PredicatedCollection<E>
org.apache.commons.collections4.set.PredicatedSet<E>
org.apache.commons.collections4.set.PredicatedSortedSet<E>
org.apache.commons.collections4.set.PredicatedNavigableSet<E>
- Type Parameters:
E- the type of the elements in this set
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>,NavigableSet<E>,SequencedCollection<E>,SequencedSet<E>,Set<E>,SortedSet<E>
Decorates another
NavigableSet to validate that all additions
match a specified predicate.
This set exists to provide validation for the decorated set. It is normally created to decorate an empty set. If an object cannot be added to the set, an IllegalArgumentException is thrown.
One usage would be to ensure that no null entries are added to the set.
NavigableSet set =
PredicatedSortedSet.predicatedNavigableSet(new TreeSet(),
NotNullPredicate.notNullPredicate());
- Since:
- 4.1
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.collections4.collection.PredicatedCollection
PredicatedCollection.Builder<E> -
Method Summary
Modifier and TypeMethodDescriptionpollLast()static <E> PredicatedNavigableSet<E> predicatedNavigableSet(NavigableSet<E> set, Predicate<? super E> predicate) Factory method to create a predicated (validating) navigable set.Methods inherited from class org.apache.commons.collections4.set.PredicatedSortedSet
comparator, first, headSet, last, predicatedSortedSet, subSet, tailSetMethods inherited from class org.apache.commons.collections4.set.PredicatedSet
equals, hashCode, predicatedSetMethods inherited from class org.apache.commons.collections4.collection.PredicatedCollection
add, addAll, builder, notNullBuilder, predicatedCollectionMethods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator
clear, contains, containsAll, isEmpty, iterator, remove, removeAll, removeIf, retainAll, size, toArray, toArray, toStringMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.NavigableSet
headSet, iterator, removeFirst, removeLast, reversed, subSet, tailSetMethods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArrayMethods inherited from interface java.util.SortedSet
addFirst, addLast, comparator, first, getFirst, getLast, last, spliterator
-
Method Details
-
lower
- Specified by:
lowerin interfaceNavigableSet<E>
-
floor
- Specified by:
floorin interfaceNavigableSet<E>
-
ceiling
- Specified by:
ceilingin interfaceNavigableSet<E>
-
higher
- Specified by:
higherin interfaceNavigableSet<E>
-
pollFirst
- Specified by:
pollFirstin interfaceNavigableSet<E>
-
pollLast
- Specified by:
pollLastin interfaceNavigableSet<E>
-
descendingSet
- Specified by:
descendingSetin interfaceNavigableSet<E>
-
descendingIterator
- Specified by:
descendingIteratorin interfaceNavigableSet<E>
-
subSet
public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) - Specified by:
subSetin interfaceNavigableSet<E>
-
headSet
- Specified by:
headSetin interfaceNavigableSet<E>
-
tailSet
- Specified by:
tailSetin interfaceNavigableSet<E>