Class StructureQueryConstraint.BulkFilter
Object
BulkFilter
- All Implemented Interfaces:
StructureQueryConstraint.Sequence
- Enclosing interface:
- StructureQueryConstraint
public abstract static class StructureQueryConstraint.BulkFilter
extends Object
implements StructureQueryConstraint.Sequence
A base implementation for a constraint that looks at a bunch of rows at a time.
This class represents a "middle ground" between looking at one row at a time and at looking at all rows being filtered at once. This works best when the caller is not interested in all the results: it can stop at any moment, and the constraint will not process the rest of the rows.
-
Field Summary
FieldsFields inherited from interface StructureQueryConstraint.Sequence
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadvance(StructureQueryConstraint.Acceptor acceptor) Attempts to advance in this sequence by 0, 1 or more positions (i.e., attempts to find the next 0, 1 or more matching indices).protected abstract voidbulkFilter(IntList input, StructureQueryConstraint.Acceptor acceptor) Processes a bunch of indices and passes the matching ones to the acceptor.
-
Field Details
-
myBulkSize
protected final int myBulkSize
-
-
Constructor Details
-
BulkFilter
protected BulkFilter(IntIterator input, int bulkSize) - Parameters:
input- the incoming indices to be filtered (fromStructureQueryConstraint.filter(IntIterator, List, QueryContext)bulkSize- the size of the bulk that is processed
-
-
Method Details
-
advance
Description copied from interface:StructureQueryConstraint.SequenceAttempts to advance in this sequence by 0, 1 or more positions (i.e., attempts to find the next 0, 1 or more matching indices). Each position should be passed toacceptorthrough calls toacceptor.accept(index)oracceptor.accept(indices). Return value indicates whether this sequence is capable of producing values:falseindicates the end of this sequence.- Specified by:
advancein interfaceStructureQueryConstraint.Sequence- Parameters:
acceptor- accepts members of this sequence- Returns:
- false iff this sequence does not have any more values
-
bulkFilter
Processes a bunch of indices and passes the matching ones to the acceptor. Indices are sorted in the increasing order, and the indices are all greater than the indices from the previous calls to this method.- Parameters:
input- sorted indices to filteracceptor- accepts the results
-