Neo4j Community

org.neo4j.cypher.javacompat
Class ExecutionResult

java.lang.Object
  extended by org.neo4j.cypher.javacompat.ExecutionResult
All Implemented Interfaces:
Iterable<Map<String,Object>>

public class ExecutionResult
extends Object
implements Iterable<Map<String,Object>>

Holds Cypher query result sets, in tabular form. Each row of the result is a map of column name to result object. Each column name correlates directly with the terms used in the "return" clause of the Cypher query. The result objects could be Nodes, Relationships or java primitives. Either iterate directly over the ExecutionResult to retrieve each row of the result set, or use columnAs() to access a single column with result objects cast to a type.


Constructor Summary
ExecutionResult(org.neo4j.cypher.ExecutionResult projection)
          Constructor used by the Cypher framework.
 
Method Summary
<T> Iterator<T>
columnAs(String n)
          Provides result objects from a single column of the result set.
 List<String> columns()
          The exact names used to represent each column in the result set.
 Iterator<Map<String,Object>> iterator()
           
 String toString()
           
 void toString(PrintWriter writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExecutionResult

public ExecutionResult(org.neo4j.cypher.ExecutionResult projection)
Constructor used by the Cypher framework. End-users should not create an ExecutionResult directly, but instead use the result returned from calling ExecutionEngine.execute(org.neo4j.cypher.internal.commands.Query).

Parameters:
projection -
Method Detail

columnAs

public <T> Iterator<T> columnAs(String n)
Provides result objects from a single column of the result set. This method is best used for single column results.

Type Parameters:
T - desired type cast for the result objects
Parameters:
n - exact name of the column, as it appeared in the original query
Returns:
an iterator of the result objects, possibly empty
Throws:
ClassCastException - when the result object can not be cast to the requested type
NotFoundException - when the column name does not appear in the original query

columns

public List<String> columns()
The exact names used to represent each column in the result set.

Returns:
List of the column names.

iterator

public Iterator<Map<String,Object>> iterator()
Specified by:
iterator in interface Iterable<Map<String,Object>>

toString

public String toString()
Overrides:
toString in class Object

toString

public void toString(PrintWriter writer)

Neo4j Community

Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.