Class AndPredicate<T>
- java.lang.Object
-
- com._1c.g5.modeling.xtext.scoping.AndPredicate<T>
-
- All Implemented Interfaces:
com.google.common.base.Predicate<T>
,Predicate<T>
public class AndPredicate<T> extends Object implements com.google.common.base.Predicate<T>
Special implementation ofPredicate
. Returns a predicate that evaluates to true if each of its components evaluates to true. The components are evaluated in order, and evaluation will be "short-circuited" as soon as a false predicate is found. It defensively copies the iterable passed in, so future changes to it won't alter the behavior of this predicate. If components is empty, the returned predicate will always evaluate to true.
-
-
Constructor Summary
Constructors Constructor Description AndPredicate(com.google.common.base.Predicate<T> predicate)
ConstructorAndPredicate(Collection<com.google.common.base.Predicate<T>> predicates)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPredicate(com.google.common.base.Predicate<T> predicate)
Adds predicate for evaluatingboolean
apply(T input)
Collection<com.google.common.base.Predicate<T>>
getPredicates()
Gets all containing predicates
-
-
-
Constructor Detail
-
AndPredicate
public AndPredicate(Collection<com.google.common.base.Predicate<T>> predicates)
Constructor- Parameters:
predicates
- initial collection of predicates, can't benull
-
AndPredicate
public AndPredicate(com.google.common.base.Predicate<T> predicate)
Constructor- Parameters:
predicates
- initial predicate, can't benull
-
-
Method Detail
-
apply
public boolean apply(T input)
- Specified by:
apply
in interfacecom.google.common.base.Predicate<T>
-
addPredicate
public void addPredicate(com.google.common.base.Predicate<T> predicate)
Adds predicate for evaluating- Parameters:
predicate
- adding predicate, can't benull
-
getPredicates
public Collection<com.google.common.base.Predicate<T>> getPredicates()
Gets all containing predicates- Returns:
- collection of the containing predicates, never
null
-
-