Package | Description |
---|---|
org.apache.commons.collections4 |
This package contains the interfaces and utilities shared across all the subpackages of this component.
|
org.apache.commons.collections4.bag | |
org.apache.commons.collections4.collection |
This package contains implementations of the
Collection interface. |
org.apache.commons.collections4.functors |
This package contains implementations of the
Closure ,
Predicate ,
Transformer and
Factory interfaces. |
org.apache.commons.collections4.iterators |
This package contains implementations of the
Iterator interface. |
org.apache.commons.collections4.list |
This package contains implementations of the
List interface. |
org.apache.commons.collections4.map | |
org.apache.commons.collections4.multiset |
This package contains implementations of the
MultiSet and
SortedMultiSet interfaces. |
org.apache.commons.collections4.queue |
This package contains implementations for the
Queue interface. |
org.apache.commons.collections4.set |
This package contains implementations of the
Set ,
SortedSet and
NavigableSet interfaces. |
Modifier and Type | Method | Description |
---|---|---|
static <T> Predicate<T> |
PredicateUtils.allPredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Create a new Predicate that returns true only if all of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.allPredicate(Predicate<? super T>... predicates) |
Create a new Predicate that returns true only if all of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.andPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Create a new Predicate that returns true only if both of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.anyPredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Create a new Predicate that returns true if any of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.anyPredicate(Predicate<? super T>... predicates) |
Create a new Predicate that returns true if any of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.asPredicate(Transformer<? super T,java.lang.Boolean> transformer) |
Create a new Predicate that wraps a Transformer.
|
static <T> Predicate<T> |
PredicateUtils.eitherPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Create a new Predicate that returns true if one, but not both, of the
specified predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.equalPredicate(T value) |
Creates a Predicate that checks if the input object is equal to the
specified object using equals().
|
static <T> Predicate<T> |
PredicateUtils.exceptionPredicate() |
Gets a Predicate that always throws an exception.
|
static <T> Predicate<T> |
PredicateUtils.falsePredicate() |
Gets a Predicate that always returns false.
|
static <T> Predicate<T> |
PredicateUtils.identityPredicate(T value) |
Creates a Predicate that checks if the input object is equal to the
specified object by identity.
|
static Predicate<java.lang.Object> |
PredicateUtils.instanceofPredicate(java.lang.Class<?> type) |
Creates a Predicate that checks if the object passed in is of
a particular type, using instanceof.
|
static <T> Predicate<T> |
PredicateUtils.invokerPredicate(java.lang.String methodName) |
Creates a Predicate that invokes a method on the input object.
|
static <T> Predicate<T> |
PredicateUtils.invokerPredicate(java.lang.String methodName,
java.lang.Class<?>[] paramTypes,
java.lang.Object[] args) |
Creates a Predicate that invokes a method on the input object.
|
static <T> Predicate<T> |
PredicateUtils.neitherPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Create a new Predicate that returns true if neither of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.nonePredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Create a new Predicate that returns true if none of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.nonePredicate(Predicate<? super T>... predicates) |
Create a new Predicate that returns true if none of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.notNullPredicate() |
Gets a Predicate that checks if the input object passed in is not null.
|
static <T> Predicate<T> |
PredicateUtils.notPredicate(Predicate<? super T> predicate) |
Create a new Predicate that returns true if the specified predicate
returns false and vice versa.
|
static <T> Predicate<T> |
PredicateUtils.nullIsExceptionPredicate(Predicate<? super T> predicate) |
Gets a Predicate that throws an exception if the input object is null,
otherwise it calls the specified Predicate.
|
static <T> Predicate<T> |
PredicateUtils.nullIsFalsePredicate(Predicate<? super T> predicate) |
Gets a Predicate that returns false if the input object is null, otherwise
it calls the specified Predicate.
|
static <T> Predicate<T> |
PredicateUtils.nullIsTruePredicate(Predicate<? super T> predicate) |
Gets a Predicate that returns true if the input object is null, otherwise
it calls the specified Predicate.
|
static <T> Predicate<T> |
PredicateUtils.nullPredicate() |
Gets a Predicate that checks if the input object passed in is null.
|
static <T> Predicate<T> |
PredicateUtils.onePredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Create a new Predicate that returns true if only one of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.onePredicate(Predicate<? super T>... predicates) |
Create a new Predicate that returns true if only one of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.orPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Create a new Predicate that returns true if either of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.transformedPredicate(Transformer<? super T,? extends T> transformer,
Predicate<? super T> predicate) |
Creates a predicate that transforms the input object before passing it
to the predicate.
|
static <T> Predicate<T> |
PredicateUtils.truePredicate() |
Gets a Predicate that always returns true.
|
static <T> Predicate<T> |
PredicateUtils.uniquePredicate() |
Creates a Predicate that returns true the first time an object is
encountered, and false if the same object is received
again.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
FluentIterable.allMatch(Predicate<? super E> predicate) |
Checks if all elements contained in this iterable are matching the
provided predicate.
|
static <T> Predicate<T> |
PredicateUtils.allPredicate(Predicate<? super T>... predicates) |
Create a new Predicate that returns true only if all of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.andPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Create a new Predicate that returns true only if both of the specified
predicates are true.
|
boolean |
FluentIterable.anyMatch(Predicate<? super E> predicate) |
Checks if this iterable contains any element matching the provided predicate.
|
static <T> Predicate<T> |
PredicateUtils.anyPredicate(Predicate<? super T>... predicates) |
Create a new Predicate that returns true if any of the specified
predicates are true.
|
static <T> Transformer<T,java.lang.Boolean> |
TransformerUtils.asTransformer(Predicate<? super T> predicate) |
Creates a Transformer that calls a Predicate each time the transformer is used.
|
static <C> int |
CollectionUtils.countMatches(java.lang.Iterable<C> input,
Predicate<? super C> predicate) |
Deprecated.
since 4.1, use
IterableUtils.countMatches(Iterable, Predicate) instead |
static <E> long |
IterableUtils.countMatches(java.lang.Iterable<E> input,
Predicate<? super E> predicate) |
Counts the number of elements in the input iterable that match the predicate.
|
static <E> Closure<E> |
ClosureUtils.doWhileClosure(Closure<? super E> closure,
Predicate<? super E> predicate) |
Creates a Closure that will call the closure once and then repeatedly
until the predicate returns false.
|
static <T> Predicate<T> |
PredicateUtils.eitherPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Create a new Predicate that returns true if one, but not both, of the
specified predicates are true.
|
static <C> boolean |
CollectionUtils.exists(java.lang.Iterable<C> input,
Predicate<? super C> predicate) |
Deprecated.
since 4.1, use
IterableUtils.matchesAny(Iterable, Predicate) instead |
static <T> boolean |
CollectionUtils.filter(java.lang.Iterable<T> collection,
Predicate<? super T> predicate) |
Filter the collection by applying a Predicate to each element.
|
FluentIterable<E> |
FluentIterable.filter(Predicate<? super E> predicate) |
Returns a new FluentIterable whose iterator will only return
elements from this iterable matching the provided predicate.
|
static <E> java.lang.Iterable<E> |
IterableUtils.filteredIterable(java.lang.Iterable<E> iterable,
Predicate<? super E> predicate) |
Returns a view of the given iterable that only contains elements matching
the provided predicate.
|
static <E> java.util.Iterator<E> |
IteratorUtils.filteredIterator(java.util.Iterator<? extends E> iterator,
Predicate<? super E> predicate) |
Gets an iterator that filters another iterator.
|
static <E> java.util.ListIterator<E> |
IteratorUtils.filteredListIterator(java.util.ListIterator<? extends E> listIterator,
Predicate<? super E> predicate) |
Gets a list iterator that filters another list iterator.
|
static <T> boolean |
CollectionUtils.filterInverse(java.lang.Iterable<T> collection,
Predicate<? super T> predicate) |
Filter the collection by applying a Predicate to each element.
|
static <T> T |
CollectionUtils.find(java.lang.Iterable<T> collection,
Predicate<? super T> predicate) |
Deprecated.
since 4.1, use
IterableUtils.find(Iterable, Predicate) instead |
static <E> E |
IterableUtils.find(java.lang.Iterable<E> iterable,
Predicate<? super E> predicate) |
Finds the first element in the given iterable which matches the given predicate.
|
static <E> E |
IteratorUtils.find(java.util.Iterator<E> iterator,
Predicate<? super E> predicate) |
Finds the first element in the given iterator which matches the given predicate.
|
static <E> Closure<E> |
ClosureUtils.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure) |
Create a new Closure that calls another closure based on the
result of the specified predicate.
|
static <E> Closure<E> |
ClosureUtils.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure) |
Create a new Closure that calls one of two closures depending
on the specified predicate.
|
static <I,O> Transformer<I,O> |
TransformerUtils.ifTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer) |
Create a new Transformer that calls one of two transformers depending
on the specified predicate.
|
static <T> Transformer<T,T> |
TransformerUtils.ifTransformer(Predicate<? super T> predicate,
Transformer<? super T,? extends T> trueTransformer) |
Create a new Transformer that calls the transformer if the predicate is true,
otherwise the input object is returned unchanged.
|
static <E> int |
IterableUtils.indexOf(java.lang.Iterable<E> iterable,
Predicate<? super E> predicate) |
Returns the index of the first element in the specified iterable that
matches the given predicate.
|
static <E> int |
IteratorUtils.indexOf(java.util.Iterator<E> iterator,
Predicate<? super E> predicate) |
Returns the index of the first element in the specified iterator that
matches the given predicate.
|
static <E> int |
ListUtils.indexOf(java.util.List<E> list,
Predicate<E> predicate) |
Finds the first index in the given List which matches the given predicate.
|
static <C> boolean |
CollectionUtils.matchesAll(java.lang.Iterable<C> input,
Predicate<? super C> predicate) |
Deprecated.
since 4.1, use
IterableUtils.matchesAll(Iterable, Predicate) instead |
static <E> boolean |
IterableUtils.matchesAll(java.lang.Iterable<E> iterable,
Predicate<? super E> predicate) |
Answers true if a predicate is true for every element of an iterable.
|
static <E> boolean |
IteratorUtils.matchesAll(java.util.Iterator<E> iterator,
Predicate<? super E> predicate) |
Answers true if a predicate is true for every element of an iterator.
|
static <E> boolean |
IterableUtils.matchesAny(java.lang.Iterable<E> iterable,
Predicate<? super E> predicate) |
Answers true if a predicate is true for any element of the iterable.
|
static <E> boolean |
IteratorUtils.matchesAny(java.util.Iterator<E> iterator,
Predicate<? super E> predicate) |
Answers true if a predicate is true for any element of the iterator.
|
static <T> Predicate<T> |
PredicateUtils.neitherPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Create a new Predicate that returns true if neither of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.nonePredicate(Predicate<? super T>... predicates) |
Create a new Predicate that returns true if none of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.notPredicate(Predicate<? super T> predicate) |
Create a new Predicate that returns true if the specified predicate
returns false and vice versa.
|
static <T> Predicate<T> |
PredicateUtils.nullIsExceptionPredicate(Predicate<? super T> predicate) |
Gets a Predicate that throws an exception if the input object is null,
otherwise it calls the specified Predicate.
|
static <T> Predicate<T> |
PredicateUtils.nullIsFalsePredicate(Predicate<? super T> predicate) |
Gets a Predicate that returns false if the input object is null, otherwise
it calls the specified Predicate.
|
static <T> Predicate<T> |
PredicateUtils.nullIsTruePredicate(Predicate<? super T> predicate) |
Gets a Predicate that returns true if the input object is null, otherwise
it calls the specified Predicate.
|
static <T> Predicate<T> |
PredicateUtils.onePredicate(Predicate<? super T>... predicates) |
Create a new Predicate that returns true if only one of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.orPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Create a new Predicate that returns true if either of the specified
predicates are true.
|
static <O,R extends java.util.Collection<O>> |
IterableUtils.partition(java.lang.Iterable<? extends O> iterable,
Factory<R> partitionFactory,
Predicate<? super O>... predicates) |
Partitions all elements from iterable into separate output collections,
based on the evaluation of the given predicates.
|
static <O> java.util.List<java.util.List<O>> |
IterableUtils.partition(java.lang.Iterable<? extends O> iterable,
Predicate<? super O> predicate) |
Partitions all elements from iterable into separate output collections,
based on the evaluation of the given predicate.
|
static <O> java.util.List<java.util.List<O>> |
IterableUtils.partition(java.lang.Iterable<? extends O> iterable,
Predicate<? super O>... predicates) |
Partitions all elements from iterable into separate output collections,
based on the evaluation of the given predicates.
|
static <E> Bag<E> |
BagUtils.predicatedBag(Bag<E> bag,
Predicate<? super E> predicate) |
Returns a predicated (validating) bag backed by the given bag.
|
static <C> java.util.Collection<C> |
CollectionUtils.predicatedCollection(java.util.Collection<C> collection,
Predicate<? super C> predicate) |
Returns a predicated (validating) collection backed by the given collection.
|
static <E> java.util.List<E> |
ListUtils.predicatedList(java.util.List<E> list,
Predicate<E> predicate) |
Returns a predicated (validating) list backed by the given list.
|
static <K,V> IterableMap<K,V> |
MapUtils.predicatedMap(java.util.Map<K,V> map,
Predicate<? super K> keyPred,
Predicate<? super V> valuePred) |
Returns a predicated (validating) map backed by the given map.
|
static <E> MultiSet<E> |
MultiSetUtils.predicatedMultiSet(MultiSet<E> multiset,
Predicate<? super E> predicate) |
Returns a predicated (validating) multiset backed by the given multiset.
|
static <E> java.util.SortedSet<E> |
SetUtils.predicatedNavigableSet(java.util.NavigableSet<E> set,
Predicate<? super E> predicate) |
Returns a predicated (validating) navigable set backed by the given navigable set.
|
static <E> java.util.Queue<E> |
QueueUtils.predicatedQueue(java.util.Queue<E> queue,
Predicate<? super E> predicate) |
Returns a predicated (validating) queue backed by the given queue.
|
static <E> java.util.Set<E> |
SetUtils.predicatedSet(java.util.Set<E> set,
Predicate<? super E> predicate) |
Returns a predicated (validating) set backed by the given set.
|
static <E> SortedBag<E> |
BagUtils.predicatedSortedBag(SortedBag<E> bag,
Predicate<? super E> predicate) |
Returns a predicated (validating) sorted bag backed by the given sorted
bag.
|
static <K,V> java.util.SortedMap<K,V> |
MapUtils.predicatedSortedMap(java.util.SortedMap<K,V> map,
Predicate<? super K> keyPred,
Predicate<? super V> valuePred) |
Returns a predicated (validating) sorted map backed by the given map.
|
static <E> java.util.SortedSet<E> |
SetUtils.predicatedSortedSet(java.util.SortedSet<E> set,
Predicate<? super E> predicate) |
Returns a predicated (validating) sorted set backed by the given sorted set.
|
static <O> java.util.Collection<O> |
CollectionUtils.select(java.lang.Iterable<? extends O> inputCollection,
Predicate<? super O> predicate) |
Selects all elements from input collection which match the given
predicate into an output collection.
|
static <O,R extends java.util.Collection<? super O>> |
CollectionUtils.select(java.lang.Iterable<? extends O> inputCollection,
Predicate<? super O> predicate,
R outputCollection) |
Selects all elements from input collection which match the given
predicate and adds them to outputCollection.
|
static <O,R extends java.util.Collection<? super O>> |
CollectionUtils.select(java.lang.Iterable<? extends O> inputCollection,
Predicate<? super O> predicate,
R outputCollection,
R rejectedCollection) |
Selects all elements from inputCollection into an output and rejected collection,
based on the evaluation of the given predicate.
|
static <E> java.util.List<E> |
ListUtils.select(java.util.Collection<? extends E> inputCollection,
Predicate<? super E> predicate) |
Selects all elements from input collection which match the given
predicate into an output list.
|
static <O> java.util.Collection<O> |
CollectionUtils.selectRejected(java.lang.Iterable<? extends O> inputCollection,
Predicate<? super O> predicate) |
Selects all elements from inputCollection which don't match the given
predicate into an output collection.
|
static <O,R extends java.util.Collection<? super O>> |
CollectionUtils.selectRejected(java.lang.Iterable<? extends O> inputCollection,
Predicate<? super O> predicate,
R outputCollection) |
Selects all elements from inputCollection which don't match the given
predicate and adds them to outputCollection.
|
static <E> java.util.List<E> |
ListUtils.selectRejected(java.util.Collection<? extends E> inputCollection,
Predicate<? super E> predicate) |
Selects all elements from inputCollection which don't match the given
predicate into an output collection.
|
static <O> java.util.Collection<O> |
CollectionUtils.subtract(java.lang.Iterable<? extends O> a,
java.lang.Iterable<? extends O> b,
Predicate<O> p) |
Returns a new
Collection containing a minus a subset of
b. |
static <E> Closure<E> |
ClosureUtils.switchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures) |
Create a new Closure that calls one of the closures depending
on the predicates.
|
static <E> Closure<E> |
ClosureUtils.switchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures,
Closure<? super E> defaultClosure) |
Create a new Closure that calls one of the closures depending
on the predicates.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers) |
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers,
Transformer<? super I,? extends O> defaultTransformer) |
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer) |
Deprecated.
as of 4.1, use {@link #ifTransformer(Predicate, Transformer, Transformer))
|
static <T> Predicate<T> |
PredicateUtils.transformedPredicate(Transformer<? super T,? extends T> transformer,
Predicate<? super T> predicate) |
Creates a predicate that transforms the input object before passing it
to the predicate.
|
static <E> Closure<E> |
ClosureUtils.whileClosure(Predicate<? super E> predicate,
Closure<? super E> closure) |
Creates a Closure that will call the closure repeatedly until the
predicate returns false.
|
Modifier and Type | Method | Description |
---|---|---|
static <T> Predicate<T> |
PredicateUtils.allPredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Create a new Predicate that returns true only if all of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.anyPredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Create a new Predicate that returns true if any of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.nonePredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Create a new Predicate that returns true if none of the specified
predicates are true.
|
static <T> Predicate<T> |
PredicateUtils.onePredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Create a new Predicate that returns true if only one of the specified
predicates are true.
|
static <E> Closure<E> |
ClosureUtils.switchClosure(java.util.Map<Predicate<E>,Closure<E>> predicatesAndClosures) |
Create a new Closure that calls one of the closures depending
on the predicates.
|
static <I,O> Transformer<I,O> |
TransformerUtils.switchTransformer(java.util.Map<Predicate<I>,Transformer<I,O>> predicatesAndTransformers) |
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
Modifier and Type | Method | Description |
---|---|---|
static <E> PredicatedBag<E> |
PredicatedBag.predicatedBag(Bag<E> bag,
Predicate<? super E> predicate) |
Factory method to create a predicated (validating) bag.
|
static <E> PredicatedSortedBag<E> |
PredicatedSortedBag.predicatedSortedBag(SortedBag<E> bag,
Predicate<? super E> predicate) |
Factory method to create a predicated (validating) bag.
|
Constructor | Description |
---|---|
PredicatedBag(Bag<E> bag,
Predicate<? super E> predicate) |
Constructor that wraps (not copies).
|
PredicatedSortedBag(SortedBag<E> bag,
Predicate<? super E> predicate) |
Constructor that wraps (not copies).
|
Modifier and Type | Field | Description |
---|---|---|
protected Predicate<? super E> |
PredicatedCollection.predicate |
The predicate to use
|
Modifier and Type | Method | Description |
---|---|---|
static <E> PredicatedCollection.Builder<E> |
PredicatedCollection.builder(Predicate<? super E> predicate) |
Returns a Builder with the given predicate.
|
static <T> PredicatedCollection<T> |
PredicatedCollection.predicatedCollection(java.util.Collection<T> coll,
Predicate<? super T> predicate) |
Factory method to create a predicated (validating) collection.
|
Constructor | Description |
---|---|
Builder(Predicate<? super E> predicate) |
Constructs a PredicatedCollectionBuilder with the specified Predicate.
|
PredicatedCollection(java.util.Collection<E> coll,
Predicate<? super E> predicate) |
Constructor that wraps (not copies).
|
Modifier and Type | Interface | Description |
---|---|---|
interface |
PredicateDecorator<T> |
Defines a predicate that decorates one or more other predicates.
|
Modifier and Type | Class | Description |
---|---|---|
class |
AbstractQuantifierPredicate<T> |
Abstract base class for quantification predicates, e.g.
|
class |
AllPredicate<T> |
Predicate implementation that returns true if all the
predicates return true.
|
class |
AndPredicate<T> |
Predicate implementation that returns true if both the predicates return true.
|
class |
AnyPredicate<T> |
Predicate implementation that returns true if any of the
predicates return true.
|
class |
ComparatorPredicate<T> |
Predicate that compares the input object with the one stored in the predicate using a comparator.
|
class |
EqualPredicate<T> |
Predicate implementation that returns true if the input is the same object
as the one stored in this predicate by equals.
|
class |
ExceptionPredicate<T> |
Predicate implementation that always throws an exception.
|
class |
FalsePredicate<T> |
Predicate implementation that always returns false.
|
class |
IdentityPredicate<T> |
Predicate implementation that returns true if the input is the same object
as the one stored in this predicate.
|
class |
InstanceofPredicate |
Predicate implementation that returns true if the input is an instanceof
the type stored in this predicate.
|
class |
NonePredicate<T> |
Predicate implementation that returns true if none of the
predicates return true.
|
class |
NotNullPredicate<T> |
Predicate implementation that returns true if the input is not null.
|
class |
NotPredicate<T> |
Predicate implementation that returns the opposite of the decorated predicate.
|
class |
NullIsExceptionPredicate<T> |
Predicate implementation that throws an exception if the input is null.
|
class |
NullIsFalsePredicate<T> |
Predicate implementation that returns false if the input is null.
|
class |
NullIsTruePredicate<T> |
Predicate implementation that returns true if the input is null.
|
class |
NullPredicate<T> |
Predicate implementation that returns true if the input is null.
|
class |
OnePredicate<T> |
Predicate implementation that returns true if only one of the
predicates return true.
|
class |
OrPredicate<T> |
Predicate implementation that returns true if either of the predicates return true.
|
class |
TransformedPredicate<T> |
Predicate implementation that transforms the given object before invoking
another
Predicate . |
class |
TransformerPredicate<T> |
Predicate implementation that returns the result of a transformer.
|
class |
TruePredicate<T> |
Predicate implementation that always returns true.
|
class |
UniquePredicate<T> |
Predicate implementation that returns true the first time an object is
passed into the predicate.
|
Modifier and Type | Field | Description |
---|---|---|
static Predicate |
ExceptionPredicate.INSTANCE |
Singleton predicate instance
|
static Predicate |
FalsePredicate.INSTANCE |
Singleton predicate instance
|
static Predicate |
NotNullPredicate.INSTANCE |
Singleton predicate instance
|
static Predicate |
NullPredicate.INSTANCE |
Singleton predicate instance
|
static Predicate |
TruePredicate.INSTANCE |
Singleton predicate instance
|
protected Predicate<? super T>[] |
AbstractQuantifierPredicate.iPredicates |
The array of predicates to call
|
Modifier and Type | Method | Description |
---|---|---|
static <T> Predicate<T> |
AllPredicate.allPredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
AllPredicate.allPredicate(Predicate<? super T>... predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
AndPredicate.andPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Factory to create the predicate.
|
static <T> Predicate<T> |
AnyPredicate.anyPredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
AnyPredicate.anyPredicate(Predicate<? super T>... predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
ComparatorPredicate.comparatorPredicate(T object,
java.util.Comparator<T> comparator) |
Factory to create the comparator predicate
|
static <T> Predicate<T> |
ComparatorPredicate.comparatorPredicate(T object,
java.util.Comparator<T> comparator,
ComparatorPredicate.Criterion criterion) |
Factory to create the comparator predicate
|
static <T> Predicate<T> |
EqualPredicate.equalPredicate(T object) |
Factory to create the predicate.
|
static <T> Predicate<T> |
EqualPredicate.equalPredicate(T object,
Equator<T> equator) |
Factory to create the identity predicate.
|
static <T> Predicate<T> |
ExceptionPredicate.exceptionPredicate() |
Factory returning the singleton instance.
|
static <T> Predicate<T> |
FalsePredicate.falsePredicate() |
Get a typed instance.
|
Predicate<? super E> |
IfClosure.getPredicate() |
Gets the predicate.
|
Predicate<? super I> |
IfTransformer.getPredicate() |
Gets the predicate.
|
Predicate<? super T> |
PredicateTransformer.getPredicate() |
Gets the predicate.
|
Predicate<? super E> |
WhileClosure.getPredicate() |
Gets the predicate in use.
|
Predicate<? super T>[] |
AbstractQuantifierPredicate.getPredicates() |
Gets the predicates.
|
Predicate<? super T>[] |
AndPredicate.getPredicates() |
Gets the two predicates being decorated as an array.
|
Predicate<? super T>[] |
NotPredicate.getPredicates() |
Gets the predicate being decorated.
|
Predicate<? super T>[] |
NullIsExceptionPredicate.getPredicates() |
Gets the predicate being decorated.
|
Predicate<? super T>[] |
NullIsFalsePredicate.getPredicates() |
Gets the predicate being decorated.
|
Predicate<? super T>[] |
NullIsTruePredicate.getPredicates() |
Gets the predicate being decorated.
|
Predicate<? super T>[] |
OrPredicate.getPredicates() |
Gets the two predicates being decorated as an array.
|
Predicate<? super T>[] |
PredicateDecorator.getPredicates() |
Gets the predicates being decorated as an array.
|
Predicate<? super E>[] |
SwitchClosure.getPredicates() |
Gets the predicates.
|
Predicate<? super I>[] |
SwitchTransformer.getPredicates() |
Gets the predicates.
|
Predicate<? super T>[] |
TransformedPredicate.getPredicates() |
Gets the predicate being decorated.
|
static <T> Predicate<T> |
IdentityPredicate.identityPredicate(T object) |
Factory to create the identity predicate.
|
static Predicate<java.lang.Object> |
InstanceofPredicate.instanceOfPredicate(java.lang.Class<?> type) |
Factory to create the identity predicate.
|
static <T> Predicate<T> |
NonePredicate.nonePredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
NonePredicate.nonePredicate(Predicate<? super T>... predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
NotNullPredicate.notNullPredicate() |
Factory returning the singleton instance.
|
static <T> Predicate<T> |
NotPredicate.notPredicate(Predicate<? super T> predicate) |
Factory to create the not predicate.
|
static <T> Predicate<T> |
NullIsExceptionPredicate.nullIsExceptionPredicate(Predicate<? super T> predicate) |
Factory to create the null exception predicate.
|
static <T> Predicate<T> |
NullIsFalsePredicate.nullIsFalsePredicate(Predicate<? super T> predicate) |
Factory to create the null false predicate.
|
static <T> Predicate<T> |
NullIsTruePredicate.nullIsTruePredicate(Predicate<? super T> predicate) |
Factory to create the null true predicate.
|
static <T> Predicate<T> |
NullPredicate.nullPredicate() |
Factory returning the singleton instance.
|
static <T> Predicate<T> |
OnePredicate.onePredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
OnePredicate.onePredicate(Predicate<? super T>... predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
OrPredicate.orPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Factory to create the predicate.
|
static <T> Predicate<T> |
TransformedPredicate.transformedPredicate(Transformer<? super T,? extends T> transformer,
Predicate<? super T> predicate) |
Factory to create the predicate.
|
static <T> Predicate<T> |
TransformerPredicate.transformerPredicate(Transformer<? super T,java.lang.Boolean> transformer) |
Factory to create the predicate.
|
static <T> Predicate<T> |
TruePredicate.truePredicate() |
Factory returning the singleton instance.
|
static <T> Predicate<T> |
UniquePredicate.uniquePredicate() |
Factory to create the predicate.
|
Modifier and Type | Method | Description |
---|---|---|
static <T> Predicate<T> |
AllPredicate.allPredicate(Predicate<? super T>... predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
AndPredicate.andPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Factory to create the predicate.
|
static <T> Predicate<T> |
AnyPredicate.anyPredicate(Predicate<? super T>... predicates) |
Factory to create the predicate.
|
static <E> Closure<E> |
IfClosure.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure) |
Factory method that performs validation.
|
static <E> Closure<E> |
IfClosure.ifClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure) |
Factory method that performs validation.
|
static <I,O> Transformer<I,O> |
IfTransformer.ifTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer) |
Factory method that performs validation.
|
static <T> Transformer<T,T> |
IfTransformer.ifTransformer(Predicate<? super T> predicate,
Transformer<? super T,? extends T> trueTransformer) |
Factory method that performs validation.
|
static <T> Predicate<T> |
NonePredicate.nonePredicate(Predicate<? super T>... predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
NotPredicate.notPredicate(Predicate<? super T> predicate) |
Factory to create the not predicate.
|
static <T> Predicate<T> |
NullIsExceptionPredicate.nullIsExceptionPredicate(Predicate<? super T> predicate) |
Factory to create the null exception predicate.
|
static <T> Predicate<T> |
NullIsFalsePredicate.nullIsFalsePredicate(Predicate<? super T> predicate) |
Factory to create the null false predicate.
|
static <T> Predicate<T> |
NullIsTruePredicate.nullIsTruePredicate(Predicate<? super T> predicate) |
Factory to create the null true predicate.
|
static <T> Predicate<T> |
OnePredicate.onePredicate(Predicate<? super T>... predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
OrPredicate.orPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Factory to create the predicate.
|
static <T> Transformer<T,java.lang.Boolean> |
PredicateTransformer.predicateTransformer(Predicate<? super T> predicate) |
Factory method that performs validation.
|
static <E> Closure<E> |
SwitchClosure.switchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures,
Closure<? super E> defaultClosure) |
Factory method that performs validation and copies the parameter arrays.
|
static <I,O> Transformer<I,O> |
SwitchTransformer.switchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers,
Transformer<? super I,? extends O> defaultTransformer) |
Factory method that performs validation and copies the parameter arrays.
|
static <T> Predicate<T> |
TransformedPredicate.transformedPredicate(Transformer<? super T,? extends T> transformer,
Predicate<? super T> predicate) |
Factory to create the predicate.
|
static <E> Closure<E> |
WhileClosure.whileClosure(Predicate<? super E> predicate,
Closure<? super E> closure,
boolean doLoop) |
Factory method that performs validation.
|
Modifier and Type | Method | Description |
---|---|---|
static <T> Predicate<T> |
AllPredicate.allPredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
AnyPredicate.anyPredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
NonePredicate.nonePredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Factory to create the predicate.
|
static <T> Predicate<T> |
OnePredicate.onePredicate(java.util.Collection<? extends Predicate<? super T>> predicates) |
Factory to create the predicate.
|
static <E> Closure<E> |
SwitchClosure.switchClosure(java.util.Map<Predicate<E>,Closure<E>> predicatesAndClosures) |
Create a new Closure that calls one of the closures depending
on the predicates.
|
static <I,O> Transformer<I,O> |
SwitchTransformer.switchTransformer(java.util.Map<? extends Predicate<? super I>,? extends Transformer<? super I,? extends O>> map) |
Create a new Transformer that calls one of the transformers depending
on the predicates.
|
Constructor | Description |
---|---|
AbstractQuantifierPredicate(Predicate<? super T>... predicates) |
Constructor that performs no validation.
|
AllPredicate(Predicate<? super T>... predicates) |
Constructor that performs no validation.
|
AndPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Constructor that performs no validation.
|
AnyPredicate(Predicate<? super T>... predicates) |
Constructor that performs no validation.
|
IfClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure) |
Constructor that performs no validation.
|
IfClosure(Predicate<? super E> predicate,
Closure<? super E> trueClosure,
Closure<? super E> falseClosure) |
Constructor that performs no validation.
|
IfTransformer(Predicate<? super I> predicate,
Transformer<? super I,? extends O> trueTransformer,
Transformer<? super I,? extends O> falseTransformer) |
Constructor that performs no validation.
|
NonePredicate(Predicate<? super T>... predicates) |
Constructor that performs no validation.
|
NotPredicate(Predicate<? super T> predicate) |
Constructor that performs no validation.
|
NullIsExceptionPredicate(Predicate<? super T> predicate) |
Constructor that performs no validation.
|
NullIsFalsePredicate(Predicate<? super T> predicate) |
Constructor that performs no validation.
|
NullIsTruePredicate(Predicate<? super T> predicate) |
Constructor that performs no validation.
|
OnePredicate(Predicate<? super T>... predicates) |
Constructor that performs no validation.
|
OrPredicate(Predicate<? super T> predicate1,
Predicate<? super T> predicate2) |
Constructor that performs no validation.
|
PredicateTransformer(Predicate<? super T> predicate) |
Constructor that performs no validation.
|
SwitchClosure(Predicate<? super E>[] predicates,
Closure<? super E>[] closures,
Closure<? super E> defaultClosure) |
Constructor that performs no validation.
|
SwitchTransformer(Predicate<? super I>[] predicates,
Transformer<? super I,? extends O>[] transformers,
Transformer<? super I,? extends O> defaultTransformer) |
Constructor that performs no validation.
|
TransformedPredicate(Transformer<? super T,? extends T> transformer,
Predicate<? super T> predicate) |
Constructor that performs no validation.
|
WhileClosure(Predicate<? super E> predicate,
Closure<? super E> closure,
boolean doLoop) |
Constructor that performs no validation.
|
Modifier and Type | Method | Description |
---|---|---|
Predicate<? super E> |
FilterIterator.getPredicate() |
Gets the predicate this iterator is using.
|
Predicate<? super E> |
FilterListIterator.getPredicate() |
Gets the predicate this iterator is using.
|
Modifier and Type | Method | Description |
---|---|---|
void |
FilterIterator.setPredicate(Predicate<? super E> predicate) |
Sets the predicate this the iterator to use.
|
void |
FilterListIterator.setPredicate(Predicate<? super E> predicate) |
Sets the predicate this the iterator to use.
|
Constructor | Description |
---|---|
FilterIterator(java.util.Iterator<? extends E> iterator,
Predicate<? super E> predicate) |
Constructs a new
FilterIterator that will use the
given iterator and predicate. |
FilterListIterator(java.util.ListIterator<? extends E> iterator,
Predicate<? super E> predicate) |
Constructs a new
FilterListIterator . |
FilterListIterator(Predicate<? super E> predicate) |
Constructs a new
FilterListIterator that will not function
until setListIterator is invoked. |
Modifier and Type | Method | Description |
---|---|---|
static <T> PredicatedList<T> |
PredicatedList.predicatedList(java.util.List<T> list,
Predicate<? super T> predicate) |
Factory method to create a predicated (validating) list.
|
Constructor | Description |
---|---|
PredicatedList(java.util.List<E> list,
Predicate<? super E> predicate) |
Constructor that wraps (not copies).
|
Modifier and Type | Field | Description |
---|---|---|
protected Predicate<? super K> |
PredicatedMap.keyPredicate |
The key predicate to use
|
protected Predicate<? super V> |
PredicatedMap.valuePredicate |
The value predicate to use
|
Modifier and Type | Method | Description |
---|---|---|
static <K,V> PredicatedMap<K,V> |
PredicatedMap.predicatedMap(java.util.Map<K,V> map,
Predicate<? super K> keyPredicate,
Predicate<? super V> valuePredicate) |
Factory method to create a predicated (validating) map.
|
static <K,V> PredicatedSortedMap<K,V> |
PredicatedSortedMap.predicatedSortedMap(java.util.SortedMap<K,V> map,
Predicate<? super K> keyPredicate,
Predicate<? super V> valuePredicate) |
Factory method to create a predicated (validating) sorted map.
|
Constructor | Description |
---|---|
PredicatedMap(java.util.Map<K,V> map,
Predicate<? super K> keyPredicate,
Predicate<? super V> valuePredicate) |
Constructor that wraps (not copies).
|
PredicatedSortedMap(java.util.SortedMap<K,V> map,
Predicate<? super K> keyPredicate,
Predicate<? super V> valuePredicate) |
Constructor that wraps (not copies).
|
Modifier and Type | Method | Description |
---|---|---|
static <E> PredicatedMultiSet<E> |
PredicatedMultiSet.predicatedMultiSet(MultiSet<E> multiset,
Predicate<? super E> predicate) |
Factory method to create a predicated (validating) multiset.
|
Constructor | Description |
---|---|
PredicatedMultiSet(MultiSet<E> multiset,
Predicate<? super E> predicate) |
Constructor that wraps (not copies).
|
Modifier and Type | Method | Description |
---|---|---|
static <E> PredicatedQueue<E> |
PredicatedQueue.predicatedQueue(java.util.Queue<E> Queue,
Predicate<? super E> predicate) |
Factory method to create a predicated (validating) queue.
|
Constructor | Description |
---|---|
PredicatedQueue(java.util.Queue<E> queue,
Predicate<? super E> predicate) |
Constructor that wraps (not copies).
|
Modifier and Type | Method | Description |
---|---|---|
static <E> PredicatedNavigableSet<E> |
PredicatedNavigableSet.predicatedNavigableSet(java.util.NavigableSet<E> set,
Predicate<? super E> predicate) |
Factory method to create a predicated (validating) navigable set.
|
static <E> PredicatedSet<E> |
PredicatedSet.predicatedSet(java.util.Set<E> set,
Predicate<? super E> predicate) |
Factory method to create a predicated (validating) set.
|
static <E> PredicatedSortedSet<E> |
PredicatedSortedSet.predicatedSortedSet(java.util.SortedSet<E> set,
Predicate<? super E> predicate) |
Factory method to create a predicated (validating) sorted set.
|
Constructor | Description |
---|---|
PredicatedNavigableSet(java.util.NavigableSet<E> set,
Predicate<? super E> predicate) |
Constructor that wraps (not copies).
|
PredicatedSet(java.util.Set<E> set,
Predicate<? super E> predicate) |
Constructor that wraps (not copies).
|
PredicatedSortedSet(java.util.SortedSet<E> set,
Predicate<? super E> predicate) |
Constructor that wraps (not copies).
|
Copyright © 2001-2019 - Apache Software Foundation