org.modeshape.graph.query.process
Class QueryResults.TupleCursor

java.lang.Object
  extended by org.modeshape.graph.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
protected QueryResults.TupleCursor(QueryResults.Columns columns, Iterator<Object[]> iterator)
           
 
Method Summary
 Location getLocation(int columnNumber)
          Get from the current row the location of the node from which the value in the given column was taken.
 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()
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
See Also:
QueryResults.Cursor.hasNext()

next

public void next()
Move this cursor position to the next row. obtained for

Specified by:
next in interface QueryResults.Cursor
See Also:
QueryResults.Cursor.next()

getLocation

public Location getLocation(int columnNumber)
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
See Also:
QueryResults.Cursor.getLocation(int)

getLocation

public Location getLocation(String selectorName)
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
See Also:
QueryResults.Cursor.getLocation(java.lang.String)

getRowIndex

public int getRowIndex()
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
See Also:
QueryResults.Cursor.getRowIndex()

getValue

public Object getValue(int columnNumber)
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
See Also:
QueryResults.Cursor.getValue(int)

getValue

public Object getValue(String columnName)
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
See Also:
QueryResults.Cursor.getValue(java.lang.String)


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