org.modeshape.jcr.query.engine

## Class ScanningQueryEngine.RowFilterSupplier

- java.lang.Object
- - org.modeshape.jcr.query.engine.ScanningQueryEngine.RowFilterSupplier

- All Implemented Interfaces:
    NodeSequence.RowFilter
  Enclosing class:
    ScanningQueryEngine

      protected abstract static class ScanningQueryEngine.RowFilterSupplier
      extends Object
      implements NodeSequence.RowFilter

  A `NodeSequence.RowFilter` implementation that lazily initializes the real RowFilter implementation the first time it's needed and thereafter will simply delegate to the implementation.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ScanningQueryEngine.RowFilterSupplier()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract NodeSequence.RowFilter` | `createFilter()` Instantiate the RowFilter that will be used.
    `protected NodeSequence.RowFilter` | `delegate()`
    `boolean` | `isCurrentRowValid(NodeSequence.Batch batch)` Determine if the current row in the given batch satisfies the filter and should be included in the results.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ScanningQueryEngine.RowFilterSupplier

          protected ScanningQueryEngine.RowFilterSupplier()

  - ### Method Detail

    - #### isCurrentRowValid

          public final boolean isCurrentRowValid(NodeSequence.Batch batch)

      Description copied from interface: `NodeSequence.RowFilter`
      Determine if the current row in the given batch satisfies the filter and should be included in the results.

      Implementations should never call `NodeSequence.Batch.hasNext()` or `NodeSequence.Batch.nextRow()`.

      Specified by:
        `isCurrentRowValid` in interface `NodeSequence.RowFilter`
      Parameters:
        `batch` - the batch that is at a valid row
      Returns:
        true if the current row is acceptable, or false if it should be excluded

    - #### delegate

          protected final NodeSequence.RowFilter delegate()

    - #### createFilter

          protected abstract NodeSequence.RowFilter createFilter()

      Instantiate the RowFilter that will be used. This method may be called more than once only if `#isCurrentRowValid(Batch)` is called from multiple threads.
      Returns:
        the row filter; may not be null

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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