org.modeshape.jcr.spi.index.provider

## Interface Filter.Results

- All Superinterfaces:
    AutoCloseable
  Enclosing interface:
    Filter

      public static interface Filter.Results
      extends AutoCloseable

  The results of a `Filter.filter(IndexConstraints)` operation that contains the nodes that satisfy the `supplied constraints`.

  ModeShape will periodically call `getNextBatch(ResultWriter, int)` as (additional) results are needed to answer the query. Generally, each `Filter.Results` instance will have enough state to execute the filtering steps.

  ModeShape may call this method zero or more times, based upon whether results are actually needed and in specific batch sizes. And every time this method is called, implementations should write the next batch of nodes that satisfies the criteria, where the number of nodes in the batch should be roughly equal to `batchSize`. If the index implementation is interacting with a remote system, then each method invocation might correspond to a single remote request.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close any and all resources for the operation.
    `boolean` | `getNextBatch(ResultWriter writer, int batchSize)` Obtain the next batch of results for the query.

- - ### Method Detail

    - #### getNextBatch

          boolean getNextBatch(ResultWriter writer,
                             int batchSize)

      Obtain the next batch of results for the query.
      Parameters:
        `writer` - the writer that this method should use to register results in the batch; never null
        `batchSize` - the ideal number of node keys that are to be included in this batch; always positive
      Returns:
        true if there are additional results after this batch is completed, or false if this batch contains the final results of the query

    - #### close

          void close()

      Close any and all resources for the operation. This will always be called by ModeShape when the operation is no longer needed, even if `getNextBatch(ResultWriter, int)` was never called.
      Specified by:
        `close` in interface `AutoCloseable`

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.