Package com.google.gerrit.index.query
Class AndSource<T>
- java.lang.Object
-
- com.google.gerrit.index.query.Predicate<T>
-
- com.google.gerrit.index.query.AndPredicate<T>
-
- com.google.gerrit.index.query.AndSource<T>
-
- All Implemented Interfaces:
DataSource<T>
,Matchable<T>
,Comparator<Predicate<T>>
- Direct Known Subclasses:
AndChangeSource
public class AndSource<T> extends AndPredicate<T> implements DataSource<T>, Comparator<Predicate<T>>
-
-
Field Summary
Fields Modifier and Type Field Description protected DataSource<T>
source
-
Constructor Summary
Constructors Constructor Description AndSource(Predicate<T> that, IsVisibleToPredicate<T> isVisibleToPredicate)
AndSource(Predicate<T> that, IsVisibleToPredicate<T> isVisibleToPredicate, int start)
AndSource(Collection<? extends Predicate<T>> that)
AndSource(Collection<? extends Predicate<T>> that, IsVisibleToPredicate<T> isVisibleToPredicate, int start)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Predicate<T> a, Predicate<T> b)
int
getCardinality()
boolean
isMatchable()
boolean
match(T object)
Does this predicate match this object?ResultSet<T>
read()
ResultSet<FieldBundle>
readRaw()
protected List<T>
transformBuffer(List<T> buffer)
-
Methods inherited from class com.google.gerrit.index.query.AndPredicate
copy, equals, getChild, getChildCount, getChildren, getCost, hashCode, toString
-
Methods inherited from class com.google.gerrit.index.query.Predicate
and, and, any, asMatchable, estimateCost, getLeafCount, not, or, or
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Field Detail
-
source
protected final DataSource<T> source
-
-
Constructor Detail
-
AndSource
public AndSource(Collection<? extends Predicate<T>> that)
-
AndSource
public AndSource(Predicate<T> that, IsVisibleToPredicate<T> isVisibleToPredicate)
-
AndSource
public AndSource(Predicate<T> that, IsVisibleToPredicate<T> isVisibleToPredicate, int start)
-
AndSource
public AndSource(Collection<? extends Predicate<T>> that, IsVisibleToPredicate<T> isVisibleToPredicate, int start)
-
-
Method Detail
-
read
public ResultSet<T> read()
- Specified by:
read
in interfaceDataSource<T>
- Returns:
- read from the database and return the results.
-
readRaw
public ResultSet<FieldBundle> readRaw()
- Specified by:
readRaw
in interfaceDataSource<T>
- Returns:
- read from the database and return the raw results.
-
isMatchable
public boolean isMatchable()
- Overrides:
isMatchable
in classAndPredicate<T>
-
match
public boolean match(T object)
Description copied from interface:Matchable
Does this predicate match this object?
-
getCardinality
public int getCardinality()
- Specified by:
getCardinality
in interfaceDataSource<T>
- Returns:
- an estimate of the number of results from
DataSource.read()
.
-
-