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 TypeMethodDescriptionvoid
accept
(int index) Report one matching index.void
accept
(IntIterable indices) Report several matching indices.void
willAccept
(int n) Optimization: if aSequence
knows that it is going to acceptn
indices, it might communicate this knowledge to thisAcceptor
through 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 aSequence
knows that it is going to acceptn
indices, it might communicate this knowledge to thisAcceptor
through 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 leastn
indices. Do not call this method if you are unsure that you will provide that many values.
-