Class PredicatedNavigableSet<E>

All Implemented Interfaces:
Serializable, Iterable<E>, Collection<E>, NavigableSet<E>, Set<E>, SortedSet<E>

public class PredicatedNavigableSet<E> extends PredicatedSortedSet<E> implements NavigableSet<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
Version:
$Id: PredicatedNavigableSet.java 1686855 2015-06-22 13:00:27Z tn $
See Also: