org.modeshape.jcr.query

## Interface QueryResults.Cursor

- All Known Implementing Classes:
    QueryResults.TupleCursor
  Enclosing interface:
    QueryResults

      public static interface QueryResults.Cursor

  An interface used to walk through the results.

- - ### 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

- - ### Method Detail

    - #### hasNext

          boolean hasNext()

      Determine whether this cursor can be moved from its current position to the next row.
      Returns:
        true if there is another row, or false otherwise

    - #### next

          void next()

      Move this cursor position to the next row. obtained for
      Throws:
        `NoSuchElementException` - if there is no next row that the cursor can point to.

    - #### getRowIndex

          int getRowIndex()

      Get the 0-based index of the current row.
      Returns:
        the index of the current row; never negative
      Throws:
        `IllegalStateException` - if the `next()` method has not yet been called

    - #### getLocation

          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.
      Parameters:
        `columnNumber` - the column number (0-based)
      Returns:
        the location of the node; never null
      Throws:
        `IndexOutOfBoundsException` - if the column number is negative or larger than the number of columns
        `IllegalStateException` - if the `next()` method has not yet been called, or if there are no results

    - #### getLocation

          QueryResults.Location getLocation(String selectorName)

      Get from the current row the location of the node that was produced by the named selector.
      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
      Throws:
        `NoSuchElementException` - if the selector name does not correspond to an available selector
        `IllegalStateException` - if the `next()` method has not yet been called, or if there are no results

    - #### getValue

          Object getValue(int columnNumber)

      Get from the current row the value in the given column.
      Parameters:
        `columnNumber` - the column number (0-based)
      Returns:
        the value; possibly null
      Throws:
        `IndexOutOfBoundsException` - if the column number is negative or larger than the number of columns
        `IllegalStateException` - if the `next()` method has not yet been called, or if there are no results

    - #### getValue

          Object getValue(String columnName)

      Get the value in the named column.
      Parameters:
        `columnName` - the name of the column
      Returns:
        the value; possibly null
      Throws:
        `NoSuchElementException` - if the column name does not correspond to an available column
        `IllegalStateException` - if the `next()` method has not yet been called, or if there are no results

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