org.modeshape.jcr.query.engine.process

## Class IntersectSequence.IntersectBatch

- java.lang.Object
- - org.modeshape.jcr.query.engine.process.IntersectSequence.IntersectBatch

- All Implemented Interfaces:
    NodeSequence.Batch, NodeSequence.RowAccessor
  Enclosing class:
    IntersectSequence

      protected class IntersectSequence.IntersectBatch
      extends Object
      implements NodeSequence.Batch

  A batch implementation which wraps the left batch, but return rows from the matching keys from the right. The reason is that there may be duplicate keys on the right which should really be returned in case of an INTERSECT ALL and simply looking & filtering the left batch is not enough.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `IntersectSequence.IntersectBatch(NodeSequence.Batch leftBatch)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CachedNode` | `getNode()` Get the first node in the current row.
    `CachedNode` | `getNode(int index)` Get the node at the specified index in the current row.
    `float` | `getScore()` Get the score for the first node in the current row.
    `float` | `getScore(int index)` Get the score for the specified node in the current row.
    `String` | `getWorkspaceName()` Get the name of the workspace in which exists all nodes in this batch.
    `boolean` | `hasNext()` Determine if there are more rows in this batch.
    `boolean` | `isEmpty()` Determine whether this batch is empty.
    `void` | `nextRow()` Move to the next row in this batch.
    `long` | `rowCount()` Get the number of rows in the batch, if that information is available.
    `int` | `width()` Get the number of nodes in each row.

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

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

- - ### Constructor Detail

    - #### IntersectSequence.IntersectBatch

          protected IntersectSequence.IntersectBatch(NodeSequence.Batch leftBatch)

  - ### Method Detail

    - #### width

          public int width()

      Description copied from interface: `NodeSequence.RowAccessor`
      Get the number of nodes in each row.
      Specified by:
        `width` in interface `NodeSequence.RowAccessor`
      Returns:
        the width of each row; always positive

    - #### getWorkspaceName

          public String getWorkspaceName()

      Description copied from interface: `NodeSequence.Batch`
      Get the name of the workspace in which exists all nodes in this batch.
      Specified by:
        `getWorkspaceName` in interface `NodeSequence.Batch`
      Returns:
        the workspace name; never null

    - #### isEmpty

          public boolean isEmpty()

      Description copied from interface: `NodeSequence.Batch`
      Determine whether this batch is empty.
      Specified by:
        `isEmpty` in interface `NodeSequence.Batch`
      Returns:
        the true if there are no results, or false if there is at least some

    - #### rowCount

          public long rowCount()

      Description copied from interface: `NodeSequence.Batch`
      Get the number of rows in the batch, if that information is available.
      Specified by:
        `rowCount` in interface `NodeSequence.Batch`
      Returns:
        the number of rows; may be equal to -1 if the number of rows is not known without significant overhead

    - #### hasNext

          public boolean hasNext()

      Description copied from interface: `NodeSequence.Batch`
      Determine if there are more rows in this batch.
      Specified by:
        `hasNext` in interface `NodeSequence.Batch`
      Returns:
        true if there are more rows, or false otherwise

    - #### nextRow

          public void nextRow()

      Description copied from interface: `NodeSequence.Batch`
      Move to the next row in this batch.
      Specified by:
        `nextRow` in interface `NodeSequence.Batch`

    - #### getNode

          public CachedNode getNode()

      Description copied from interface: `NodeSequence.RowAccessor`
      Get the first node in the current row. This is a convenience method that is equivalent to `getNode(0)`.
      Specified by:
        `getNode` in interface `NodeSequence.RowAccessor`
      Returns:
        the first node in the current row; may be null if there is no node at the first position in this row

    - #### getNode

          public CachedNode getNode(int index)

      Description copied from interface: `NodeSequence.RowAccessor`
      Get the node at the specified index in the current row.
      Specified by:
        `getNode` in interface `NodeSequence.RowAccessor`
      Parameters:
        `index` - the 0-based index for the node in the row; must be less than `NodeSequence.RowAccessor.width()`.
      Returns:
        the specified node in the current row; may be null if there is no node at the valid index in this row

    - #### getScore

          public float getScore()

      Description copied from interface: `NodeSequence.RowAccessor`
      Get the score for the first node in the current row. This is a convenience method that is equivalent to `getScore(0)`.
      Specified by:
        `getScore` in interface `NodeSequence.RowAccessor`
      Returns:
        the score for the first node in the current row; always 0.0f if there is no corresponding node at the valid index in this row

    - #### getScore

          public float getScore(int index)

      Description copied from interface: `NodeSequence.RowAccessor`
      Get the score for the specified node in the current row.
      Specified by:
        `getScore` in interface `NodeSequence.RowAccessor`
      Parameters:
        `index` - the 0-based index for the node in the row; must be less than `NodeSequence.RowAccessor.width()`.
      Returns:
        the score for the specified node in the current row; always 0.0f if there is no corresponding node at the valid index in this row

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