org.modeshape.jcr.query.process

## Class QueryResults.TupleCursor

- java.lang.Object
- - org.modeshape.jcr.query.process.QueryResults.TupleCursor

- All Implemented Interfaces:
    QueryResults.Cursor
  Enclosing class:
    QueryResults

      public final class QueryResults.TupleCursor
      extends Object
      implements QueryResults.Cursor

  An interface used to walk through the results.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `QueryResults.TupleCursor(QueryResults.Columns columns, Iterator<Object[]> iterator)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `QueryResults.Location` | `getLocation(int columnNumber)` Get from the current row the location of the node from which the value in the given column was taken.
    `QueryResults.Location` | `getLocation(String selectorName)` Get from the current row the location of the node that was produced by the named selector.
    `int` | `getRowIndex()` Get the 0-based index of the current row.
    `Object` | `getValue(int columnNumber)` Get from the current row the value in the given column.
    `Object` | `getValue(String columnName)` Get the value in the named column.
    `boolean` | `hasNext()` Determine whether this cursor can be moved from its current position to the next row.
    `void` | `next()` Move this cursor position to the next row. obtained for

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

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

- - ### Constructor Detail

    - #### QueryResults.TupleCursor

          protected QueryResults.TupleCursor(QueryResults.Columns columns,
                                  Iterator<Object[]> iterator)

  - ### Method Detail

    - #### hasNext

          public boolean hasNext()

      Description copied from interface: `QueryResults.Cursor`
      Determine whether this cursor can be moved from its current position to the next row.
      Specified by:
        `hasNext` in interface `QueryResults.Cursor`
      Returns:
        true if there is another row, or false otherwise

    - #### next

          public void next()

      Description copied from interface: `QueryResults.Cursor`
      Move this cursor position to the next row. obtained for
      Specified by:
        `next` in interface `QueryResults.Cursor`

    - #### getLocation

          public QueryResults.Location getLocation(int columnNumber)

      Description copied from interface: `QueryResults.Cursor`
      Get from the current row the location of the node from which the value in the given column was taken.
      Specified by:
        `getLocation` in interface `QueryResults.Cursor`
      Parameters:
        `columnNumber` - the column number (0-based)
      Returns:
        the location of the node; never null

    - #### getLocation

          public QueryResults.Location getLocation(String selectorName)

      Description copied from interface: `QueryResults.Cursor`
      Get from the current row the location of the node that was produced by the named selector.
      Specified by:
        `getLocation` in interface `QueryResults.Cursor`
      Parameters:
        `selectorName` - the name of the selector that resulted in a node appearing in the current row
      Returns:
        the location of the node; or null if there is no node corresponding to the named selector for the current row

    - #### getRowIndex

          public int getRowIndex()

      Description copied from interface: `QueryResults.Cursor`
      Get the 0-based index of the current row.
      Specified by:
        `getRowIndex` in interface `QueryResults.Cursor`
      Returns:
        the index of the current row; never negative

    - #### getValue

          public Object getValue(int columnNumber)

      Description copied from interface: `QueryResults.Cursor`
      Get from the current row the value in the given column.
      Specified by:
        `getValue` in interface `QueryResults.Cursor`
      Parameters:
        `columnNumber` - the column number (0-based)
      Returns:
        the value; possibly null

    - #### getValue

          public Object getValue(String columnName)

      Description copied from interface: `QueryResults.Cursor`
      Get the value in the named column.
      Specified by:
        `getValue` in interface `QueryResults.Cursor`
      Parameters:
        `columnName` - the name of the column
      Returns:
        the value; possibly null

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