Package com.google.gerrit.index.query
Class AndPredicate<T>
- java.lang.Object
-
- com.google.gerrit.index.query.Predicate<T>
-
- com.google.gerrit.index.query.AndPredicate<T>
-
- All Implemented Interfaces:
Matchable<T>
,Comparator<Predicate<T>>
- Direct Known Subclasses:
AndCardinalPredicate
,AndSource
,IsWatchedByPredicate
public class AndPredicate<T> extends Predicate<T> implements Matchable<T>, Comparator<Predicate<T>>
Requires all predicates to be true.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AndPredicate(Predicate<T>... that)
protected
AndPredicate(Collection<? extends Predicate<T>> that)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Predicate<T> a, Predicate<T> b)
Predicate<T>
copy(Collection<? extends Predicate<T>> children)
Create a copy of this predicate, with new children.boolean
equals(Object other)
Predicate<T>
getChild(int i)
Same asgetChildren().get(i)
int
getChildCount()
Same asgetChildren().size()
List<Predicate<T>>
getChildren()
Get the children of this predicate, if any.int
getCost()
Returns a cost estimate to run this predicate, higher figures cost more.int
hashCode()
boolean
isMatchable()
boolean
match(T object)
Does this predicate match this object?String
toString()
-
Methods inherited from class com.google.gerrit.index.query.Predicate
and, and, any, asMatchable, estimateCost, getFlattenedPredicateList, getLeafCount, getPredicateString, isLeaf, not, or, or, supportedForQueries
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
AndPredicate
@SafeVarargs protected AndPredicate(Predicate<T>... that)
-
AndPredicate
protected AndPredicate(Collection<? extends Predicate<T>> that)
-
-
Method Detail
-
getChildren
public final List<Predicate<T>> getChildren()
Description copied from class:Predicate
Get the children of this predicate, if any.- Overrides:
getChildren
in classPredicate<T>
-
getChildCount
public final int getChildCount()
Description copied from class:Predicate
Same asgetChildren().size()
- Overrides:
getChildCount
in classPredicate<T>
-
getChild
public final Predicate<T> getChild(int i)
Description copied from class:Predicate
Same asgetChildren().get(i)
-
copy
public Predicate<T> copy(Collection<? extends Predicate<T>> children)
Description copied from class:Predicate
Create a copy of this predicate, with new children.
-
isMatchable
public boolean isMatchable()
- Overrides:
isMatchable
in classPredicate<T>
-
match
public boolean match(T object)
Description copied from interface:Matchable
Does this predicate match this object?
-
getCost
public int getCost()
Description copied from interface:Matchable
Returns a cost estimate to run this predicate, higher figures cost more.
-
equals
public boolean equals(Object other)
-
compare
public int compare(Predicate<T> a, Predicate<T> b)
- Specified by:
compare
in interfaceComparator<T>
-
-