E - the type of the elements in this setpublic class PredicatedNavigableSet<E> extends PredicatedSortedSet<E> implements NavigableSet<E>
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());
PredicatedCollection.Builder<E>| Modifier and Type | Method and Description |
|---|---|
E |
ceiling(E e) |
Iterator<E> |
descendingIterator() |
NavigableSet<E> |
descendingSet() |
E |
floor(E e) |
NavigableSet<E> |
headSet(E toElement,
boolean inclusive) |
E |
higher(E e) |
E |
lower(E e) |
E |
pollFirst() |
E |
pollLast() |
static <E> PredicatedNavigableSet<E> |
predicatedNavigableSet(NavigableSet<E> set,
Predicate<? super E> predicate)
Factory method to create a predicated (validating) navigable set.
|
NavigableSet<E> |
subSet(E fromElement,
boolean fromInclusive,
E toElement,
boolean toInclusive) |
NavigableSet<E> |
tailSet(E fromElement,
boolean inclusive) |
comparator, first, headSet, last, predicatedSortedSet, subSet, tailSetequals, hashCode, predicatedSetadd, addAll, builder, notNullBuilder, predicatedCollectionclear, contains, containsAll, isEmpty, iterator, remove, removeAll, removeIf, retainAll, size, toArray, toArray, toStringheadSet, iterator, subSet, tailSetcomparator, first, last, spliteratoradd, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArrayparallelStream, removeIf, streampublic static <E> PredicatedNavigableSet<E> predicatedNavigableSet(NavigableSet<E> set, Predicate<? super E> predicate)
If there are any elements already in the set being decorated, they are validated.
E - the element typeset - the set to decorate, must not be nullpredicate - the predicate to use for validation, must not be nullNullPointerException - if set or predicate is nullIllegalArgumentException - if the set contains invalid elementspublic E lower(E e)
lower in interface NavigableSet<E>public E floor(E e)
floor in interface NavigableSet<E>public E ceiling(E e)
ceiling in interface NavigableSet<E>public E higher(E e)
higher in interface NavigableSet<E>public E pollFirst()
pollFirst in interface NavigableSet<E>public E pollLast()
pollLast in interface NavigableSet<E>public NavigableSet<E> descendingSet()
descendingSet in interface NavigableSet<E>public Iterator<E> descendingIterator()
descendingIterator in interface NavigableSet<E>public NavigableSet<E> subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive)
subSet in interface NavigableSet<E>public NavigableSet<E> headSet(E toElement, boolean inclusive)
headSet in interface NavigableSet<E>public NavigableSet<E> tailSet(E fromElement, boolean inclusive)
tailSet in interface NavigableSet<E>Copyright © 2010 - 2020 Adobe. All Rights Reserved