org.modeshape.jcr.query

## Interface NodeSequence.RowAccessor

- All Known Subinterfaces:
    BufferedRows.BufferedRow, NodeSequence.Batch
  All Known Implementing Classes:
    BufferedRows.DoubleNodeRow, BufferedRows.MultiNodeRow, BufferedRows.QuadNodeRow, BufferedRows.SingleNodeRow, BufferedRows.TripleNodeRow, HashJoinSequence.HashCrossJoinBatch, HashJoinSequence.HashJoinBatch, HashJoinSequence.HashJoinRangeBatch, HashJoinSequence.RightRowsBatch, IntersectSequence.IntersectBatch, JoinSequence.LeftOnlyBatch, JoinSequence.RightOnlyBatch, NodeSequence.AlternateSizeBatch, NodeSequence.LimitBatch, NodeSequence.MultiWidthBatch, NodeSequence.SingleWidthBatch
  Enclosing class:
    NodeSequence

      @NotThreadSafe
      public static interface NodeSequence.RowAccessor

  An interface that abstracts accessing the node(s) and score(s) in a row.

- - ### 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.
    `int` | `width()` Get the number of nodes in each row.

- - ### Method Detail

    - #### width

          int width()

      Get the number of nodes in each row.
      Returns:
        the width of each row; always positive

    - #### getNode

          CachedNode getNode()

      Get the first node in the current row. This is a convenience method that is equivalent to `getNode(0)`.
      Returns:
        the first node in the current row; may be null if there is no node at the first position in this row
      Throws:
        `NoSuchElementException` - if there is no current row

    - #### getNode

          CachedNode getNode(int index)

      Get the node at the specified index in the current row.
      Parameters:
        `index` - the 0-based index for the node in the row; must be less than `width()`.
      Returns:
        the specified node in the current row; may be null if there is no node at the valid index in this row
      Throws:
        `NoSuchElementException` - if there is no current row
        `IndexOutOfBoundsException` - if the index is not greater than 0 and less than `width()`

    - #### getScore

          float getScore()

      Get the score for the first node in the current row. This is a convenience method that is equivalent to `getScore(0)`.
      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
      Throws:
        `NoSuchElementException` - if there is no current row

    - #### getScore

          float getScore(int index)

      Get the score for the specified node in the current row.
      Parameters:
        `index` - the 0-based index for the node in the row; must be less than `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
      Throws:
        `NoSuchElementException` - if there is no current row
        `IndexOutOfBoundsException` - if the index is not greater than 0 and less than `width()`

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