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 Details

    • myBulkSize

      protected final int myBulkSize
  • Constructor Details

  • Method Details

    • advance

      public boolean advance(StructureQueryConstraint.Acceptor acceptor)
      Description copied from interface: StructureQueryConstraint.Sequence
      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). Each position should be passed to acceptor through calls to acceptor.accept(index) or acceptor.accept(indices). Return value indicates whether this sequence is capable of producing values: false indicates the end of this sequence.
      Specified by:
      advance in interface StructureQueryConstraint.Sequence
      Parameters:
      acceptor - accepts members of this sequence
      Returns:
      false iff this sequence does not have any more values
    • bulkFilter

      protected abstract void bulkFilter(IntList input, StructureQueryConstraint.Acceptor acceptor)
      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 filter
      acceptor - accepts the results