This commit is contained in:
Greg Wilkins 2016-09-08 10:35:57 +10:00
parent 55a81fd7c6
commit ada58ea65a
1 changed files with 9 additions and 3 deletions

View File

@ -65,7 +65,10 @@ public class IncludeExcludeSet<P,T> implements Predicate<T>
/**
* Construct an IncludeExclude
* @param setClass The type of {@link Set} to using internally
* @param setClass The type of {@link 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 {@link Predicate},
* then it is also used as the item test for the set, otherwise a {@link SetContainsPredicate} instance
* is created.
* @param <SET> The type of a set to use as the backing store
*/
public <SET extends Set<P>> IncludeExcludeSet(Class<SET> setClass)
@ -84,9 +87,12 @@ public class IncludeExcludeSet<P,T> implements Predicate<T>
_includePredicate = new SetContainsPredicate(_includes);
}
if(_excludes instanceof Predicate) {
if(_excludes instanceof Predicate)
{
_excludePredicate = (Predicate<T>)_excludes;
} else {
}
else
{
_excludePredicate = new SetContainsPredicate(_excludes);
}
}