org.modeshape.jcr.query.engine

## Class Results

- java.lang.Object
- - org.modeshape.jcr.query.engine.Results

- All Implemented Interfaces:
    QueryResults

      public class Results
      extends Object
      implements QueryResults

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.modeshape.jcr.query.QueryResults

      `QueryResults.Columns, QueryResults.Statistics`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Results` | `EMPTY`

    - ### Fields inherited from interface org.modeshape.jcr.query.QueryResults

      `FORMATTER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Results(QueryResults.Columns columns, QueryResults.Statistics statistics, NodeSequence rows, CachedNodeSupplier cachedNodes, Problems problems, String plan)` Create a results object for the supplied context, command, and result columns and with the supplied tuples.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CachedNodeSupplier` | `getCachedNodes()` Get the supplier with which a node can be found by key.
    `QueryResults.Columns` | `getColumns()` Get the description of the columns contained in these results.
    `String` | `getPlan()` Get a description of the query plan, if requested.
    `Problems` | `getProblems()` Get the problems encountered during execution.
    `long` | `getRowCount()` Get the number of rows in the results, if that information is available.
    `NodeSequence` | `getRows()` Get the rows that make up these query results.
    `QueryResults.Statistics` | `getStatistics()` Get the statistics that describe the time metrics for this query.
    `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`.
    `boolean` | `isEmpty()` Determine whether this results is known to be empty.
    `String` | `toString()`
    `String` | `toString(TypeSystem typeSystem, int maxTuples)` Get a string representation of this result object, with a maximum number of tuples to include.
    `void` | `toString(TypeSystem typeSystem, StringBuilder sb)` Get a string representation of this result object.
    `void` | `toString(TypeSystem typeSystem, StringBuilder sb, int maxTuples)` Get a string representation of this result object, with a maximum number of tuples to include.

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

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

- - ### Field Detail

    - #### EMPTY

          public static final Results EMPTY

  - ### Constructor Detail

    - #### Results

          public Results(QueryResults.Columns columns,
                 QueryResults.Statistics statistics,
                 NodeSequence rows,
                 CachedNodeSupplier cachedNodes,
                 Problems problems,
                 String plan)

      Create a results object for the supplied context, command, and result columns and with the supplied tuples.
      Parameters:
        `columns` - the definition of the query result columns
        `statistics` - the statistics for this query; may not be null
        `rows` - the sequence of rows; may not be null
        `cachedNodes` - the supplier for obtaining cached nodes; may not be null
        `problems` - the problems; may be null if there are no problems
        `plan` - the text representation of the query plan, if the hints asked for it

  - ### Method Detail

    - #### getCachedNodes

          public CachedNodeSupplier getCachedNodes()

      Description copied from interface: `QueryResults`
      Get the supplier with which a node can be found by key.
      Specified by:
        `getCachedNodes` in interface `QueryResults`
      Returns:
        the supplier of `CachedNode` instances; never null

    - #### getColumns

          public QueryResults.Columns getColumns()

      Description copied from interface: `QueryResults`
      Get the description of the columns contained in these results.
      Specified by:
        `getColumns` in interface `QueryResults`
      Returns:
        the column descriptions; never null

    - #### getRows

          public NodeSequence getRows()

      Description copied from interface: `QueryResults`
      Get the rows that make up these query results.
      Specified by:
        `getRows` in interface `QueryResults`
      Returns:
        the sequence of rows; never null

    - #### getRowCount

          public long getRowCount()

      Description copied from interface: `QueryResults`
      Get the number of rows in the results, if that information is available.
      Specified by:
        `getRowCount` in interface `QueryResults`
      Returns:
        the number of rows; may be equal to -1 if the number of rows is not known without significant overhead

    - #### isEmpty

          public boolean isEmpty()

      Description copied from interface: `QueryResults`
      Determine whether this results is known to be empty.
      Specified by:
        `isEmpty` in interface `QueryResults`
      Returns:
        the true if there are no results, or false if there is at least some rows or if the number of rows is not known

    - #### getPlan

          public String getPlan()

      Description copied from interface: `QueryResults`
      Get a description of the query plan, if requested.
      Specified by:
        `getPlan` in interface `QueryResults`
      Returns:
        the query plan, or null if the plan was not requested

    - #### getProblems

          public Problems getProblems()

      Description copied from interface: `QueryResults`
      Get the problems encountered during execution.
      Specified by:
        `getProblems` in interface `QueryResults`
      Returns:
        the problems; never null but possibly empty

    - #### hasErrors

          public boolean hasErrors()

      Description copied from interface: `QueryResults`
      Return true if there is at least one error recorded in the `problems`.
      Specified by:
        `hasErrors` in interface `QueryResults`
      Returns:
        true if there is one or more errors associated with the query, or false otherwise

    - #### hasWarnings

          public boolean hasWarnings()

      Description copied from interface: `QueryResults`
      Return true if there is at least one warning recorded in the `problems`.
      Specified by:
        `hasWarnings` in interface `QueryResults`
      Returns:
        true if there is one or more warnings associated with the query, or false otherwise

    - #### getStatistics

          public QueryResults.Statistics getStatistics()

      Description copied from interface: `QueryResults`
      Get the statistics that describe the time metrics for this query.
      Specified by:
        `getStatistics` in interface `QueryResults`
      Returns:
        the statistics; never null

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### toString

          public String toString(TypeSystem typeSystem,
                        int maxTuples)

      Get a string representation of this result object, with a maximum number of tuples to include.
      Parameters:
        `typeSystem` - the type system that can be used to convert the values to a string; may be null if `Object.toString()` should be used
        `maxTuples` - the maximum number of tuples to print, or `Integer.MAX_VALUE` if all the tuples are to be printed
      Returns:
        the string representation; never null

    - #### toString

          public void toString(TypeSystem typeSystem,
                      StringBuilder sb)

      Get a string representation of this result object.
      Parameters:
        `typeSystem` - the type system that can be used to convert the values to a string; may be null if `Object.toString()` should be used
        `sb` - the string builder to which the results should be written; may not be null

    - #### toString

          public void toString(TypeSystem typeSystem,
                      StringBuilder sb,
                      int maxTuples)

      Get a string representation of this result object, with a maximum number of tuples to include.
      Parameters:
        `typeSystem` - the type system that can be used to convert the values to a string; may be null if `Object.toString()` should be used
        `sb` - the string builder to which the results should be written; may not be null
        `maxTuples` - the maximum number of tuples to print, or `Integer.MAX_VALUE` if all the tuples are to be printed

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