Package org.eclipse.jetty.util
Class IncludeExcludeSet<T,P> 
java.lang.Object
org.eclipse.jetty.util.IncludeExcludeSet<T,P> 
- Type Parameters:
- T- The type of element of the set (often a pattern)
- P- The type of the instance passed to the predicate
- All Implemented Interfaces:
- Predicate<P>
- Direct Known Subclasses:
- IncludeExclude
Utility class to maintain a set of inclusions and exclusions.
 
Maintains a set of included and excluded elements.  The method test(Object)
 will return true IFF the passed object is not in the excluded set AND ( either the
 included set is empty OR the object is in the included set)
 
The type of the underlying Set used may be passed into the
 constructor, so special sets like Servlet PathMap may be used.
 
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
IncludeExcludeSetpublic IncludeExcludeSet()Default constructor overHashSet
- 
IncludeExcludeSetConstruct an IncludeExclude.- Type Parameters:
- SET- The type of- Setto use as the backing store
- Parameters:
- setClass- The type of- Setto using internally to hold patterns. Two instances will be created. one for include patterns and one for exclude patters. If the class is also a- Predicate, then it is also used as the item test for the set, otherwise a- IncludeExcludeSet.SetContainsPredicateinstance is created.
 
- 
IncludeExcludeSetpublic IncludeExcludeSet(Set<T> includeSet, Predicate<P> includePredicate, Set<T> excludeSet, Predicate<P> excludePredicate) Construct an IncludeExclude- Type Parameters:
- SET- The type of- Setto use as the backing store
- Parameters:
- includeSet- the Set of items that represent the included space
- includePredicate- the Predicate for included item testing (null for simple- Set.contains(Object)test)
- excludeSet- the Set of items that represent the excluded space
- excludePredicate- the Predicate for excluded item testing (null for simple- Set.contains(Object)test)
 
 
- 
- 
Method Details- 
include
- 
include
- 
exclude
- 
exclude
- 
testTest includes and excludes for match.Excludes always win over includes. Empty includes means all inputs are allowed. 
- 
isIncludedAndNotExcludedTest Included and not Excluded- Parameters:
- item- The item to test
- Returns:
- Boolean.TRUEif item is included,- Boolean.FALSEif item is excluded, or null if neither
 
- 
hasIncludespublic boolean hasIncludes()
- 
hasExcludespublic boolean hasExcludes()
- 
sizepublic int size()
- 
getIncluded
- 
getExcluded
- 
clearpublic void clear()
- 
toString
- 
isEmptypublic boolean isEmpty()
 
-