Interface StructureQueryConstraint.Acceptor
- Enclosing interface:
- StructureQueryConstraint
@PublicApi
public static interface StructureQueryConstraint.Acceptor
Represents the consumer of
StructureQueryConstraint.Sequence values - i.e., the consumer of matching indices.-
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(int index) Report one matching index.voidaccept(IntIterable indices) Report several matching indices.voidwillAccept(int n) Optimization: if aSequenceknows that it is going to acceptnindices, it might communicate this knowledge to thisAcceptorthrough this method, so that the latter can preallocate internal buffers.
-
Method Details
-
accept
void accept(int index) Report one matching index.- Parameters:
index- matching index
-
accept
void accept(IntIterable indices) Report several matching indices.- Parameters:
indices- matching indices (increasing)
-
willAccept
void willAccept(int n) Optimization: if aSequenceknows that it is going to acceptnindices, it might communicate this knowledge to thisAcceptorthrough this method, so that the latter can preallocate internal buffers. Important: if this method is called, it must be followed by calls toaccept(int)oraccept(IntIterable)that provide at leastnindices. Do not call this method if you are unsure that you will provide that many values.
-