Class StructureQueryConstraint.SimpleFilter
Object
SimpleFilter
- All Implemented Interfaces:
StructureQueryConstraint.Sequence
- Enclosing interface:
- StructureQueryConstraint
public abstract static class StructureQueryConstraint.SimpleFilter
extends Object
implements StructureQueryConstraint.Sequence
A base implementation for a simple constraint that looks at one row at a time.
-
Field Summary
Fields 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).abstract booleanmatches(int index) Returnstrueif the row at the specified index matches the criteria.
-
Constructor Details
-
SimpleFilter
protected SimpleFilter(IntIterator input) - Parameters:
input- the incoming indices to be filtered (fromStructureQueryConstraint.filter(IntIterator, List, QueryContext)
-
-
Method Details
-
matches
public abstract boolean matches(int index) Returnstrueif the row at the specified index matches the criteria.- Parameters:
index- index into the forest being searched
-
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
-