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 Type
    Method
    Description
    void
    accept(int index)
    Report one matching index.
    void
    accept(IntIterable indices)
    Report several matching indices.
    void
    willAccept(int n)
    Optimization: if a Sequence knows that it is going to accept n indices, it might communicate this knowledge to this Acceptor 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 a Sequence knows that it is going to accept n indices, it might communicate this knowledge to this Acceptor through this method, so that the latter can preallocate internal buffers. Important: if this method is called, it must be followed by calls to accept(int) or accept(IntIterable) that provide at least n indices. Do not call this method if you are unsure that you will provide that many values.