org.modeshape.graph.query
Interface QueryResults

All Superinterfaces:
Serializable
All Known Implementing Classes:
QueryResults

@Immutable
public interface QueryResults
extends Serializable

The resulting output of a query.


Nested Class Summary
static interface QueryResults.Columns
          Definition of the columns that are available in the results, which outline the structure of the tuples in the results, and which can be used to access the individual values in each of the tuples.
static interface QueryResults.Cursor
          An interface used to walk through the results.
static class QueryResults.Statistics
           
 
Field Summary
static ThreadLocal<DecimalFormat> FORMATTER
           
 
Method Summary
 QueryResults.Columns getColumns()
          Get the description of the columns contained in these results.
 QueryResults.Cursor getCursor()
          Get a cursor that can be used to walk through the results.
 String getPlan()
          Get a description of the query plan, if requested.
 Problems getProblems()
          Get the problems encountered during execution.
 int getRowCount()
          Get the number of rows in the results.
 QueryResults.Statistics getStatistics()
          Get the statistics that describe the time metrics for this query.
 List<Object[]> getTuples()
          Get the actual tuples that contain the results.
 boolean hasErrors()
          Return true if there is at least one error recorded in the problems.
 boolean hasWarnings()
          Return true if there is at least one warning recorded in the problems.
 

Field Detail

FORMATTER

static final ThreadLocal<DecimalFormat> FORMATTER
Method Detail

getColumns

QueryResults.Columns getColumns()
Get the description of the columns contained in these results. These columns can be used to discover the indexes of the corresponding values from the arrays representing the tuples.

Returns:
the column descriptions; never null

getCursor

QueryResults.Cursor getCursor()
Get a cursor that can be used to walk through the results.

Returns:
the cursor; never null, though possibly empty (meaning QueryResults.Cursor.hasNext() may return true)

getTuples

List<Object[]> getTuples()
Get the actual tuples that contain the results. Each element in the list represents a tuple, and each tuple corresponds to the column definitions.

Returns:
the list of tuples; never null but possibly empty

getRowCount

int getRowCount()
Get the number of rows in the results.

Returns:
the number of rows; never negative

getPlan

String getPlan()
Get a description of the query plan, if requested.

Returns:
the query plan, or null if the plan was not requested

getProblems

Problems getProblems()
Get the problems encountered during execution.

Returns:
the problems; never null but possibly empty

hasErrors

boolean hasErrors()
Return true if there is at least one error recorded in the problems.

Returns:
true if there is one or more errors associated with the query, or false otherwise

hasWarnings

boolean hasWarnings()
Return true if there is at least one warning recorded in the problems.

Returns:
true if there is one or more warnings associated with the query, or false otherwise

getStatistics

QueryResults.Statistics getStatistics()
Get the statistics that describe the time metrics for this query.

Returns:
the statistics; never null


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