P
- The type of element of the set (often a pattern)T
- The type of the instance passed to the predicatepublic class IncludeExcludeSet<P,T> extends Object implements Predicate<T>
Maintains a set of included and excluded elements. The method matches(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 and Description |
---|
IncludeExcludeSet()
Default constructor over
HashSet |
IncludeExcludeSet(Class<SET> setClass)
Construct an IncludeExclude.
|
IncludeExcludeSet(Set<P> includeSet,
Predicate<T> includePredicate,
Set<P> excludeSet,
Predicate<T> excludePredicate)
Construct an IncludeExclude
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
exclude(P... element) |
void |
exclude(P element) |
Set<P> |
getExcluded() |
Set<P> |
getIncluded() |
void |
include(P... element) |
void |
include(P element) |
boolean |
isEmpty() |
boolean |
matches(T t) |
int |
size() |
boolean |
test(T t) |
String |
toString() |
public IncludeExcludeSet()
HashSet
public IncludeExcludeSet(Class<SET> setClass)
SET
- The type of a set to use as the backing storesetClass
- The type of Set
to 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 SetContainsPredicate
instance
is created.public IncludeExcludeSet(Set<P> includeSet, Predicate<T> includePredicate, Set<P> excludeSet, Predicate<T> excludePredicate)
SET
- The type of a set to use as the backing storeincludeSet
- the Set of items that represent the included spaceincludePredicate
- the Predicate for included item testing (null for simple Set.contains(Object)
test)excludeSet
- the Set of items that represent the excluded spaceexcludePredicate
- the Predicate for excluded item testing (null for simple Set.contains(Object)
test)Copyright © 1995-2016 Webtide. All Rights Reserved.