com.datastax.driver.core
Class ResultSet

java.lang.Object
  extended by com.datastax.driver.core.ResultSet
All Implemented Interfaces:
Iterable<Row>

public class ResultSet
extends Object
implements Iterable<Row>

The result of a query. Note that this class is not thread-safe.


Method Summary
 List<Row> all()
          Returns all the remaining rows in this ResultSet as a list.
 ColumnDefinitions getColumnDefinitions()
          Returns the columns returned in this ResultSet.
 ExecutionInfo getExecutionInfo()
          Returns information on the execution of this query.
 boolean isExhausted()
          Returns whether this ResultSet has more results.
 Iterator<Row> iterator()
          Returns an iterator over the rows contained in this ResultSet.
 Row one()
          Returns the the next result from this ResultSet.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getColumnDefinitions

public ColumnDefinitions getColumnDefinitions()
Returns the columns returned in this ResultSet.

Returns:
the columns returned in this ResultSet.

isExhausted

public boolean isExhausted()
Returns whether this ResultSet has more results.

Returns:
whether this ResultSet has more results.

one

public Row one()
Returns the the next result from this ResultSet.

Returns:
the next row in this resultSet or null if this ResultSet is exhausted.

all

public List<Row> all()
Returns all the remaining rows in this ResultSet as a list.

Returns:
a list containing the remaining results of this ResultSet. The returned list is empty if and only the ResultSet is exhausted.

iterator

public Iterator<Row> iterator()
Returns an iterator over the rows contained in this ResultSet. The Iterator.next() method is equivalent to calling one(). So this iterator will consume results from this ResultSet and after a full iteration, the ResultSet will be empty. The returned iterator does not support the Iterator.remove() method.

Specified by:
iterator in interface Iterable<Row>
Returns:
an iterator that will consume and return the remaining rows of this ResultSet.

getExecutionInfo

public ExecutionInfo getExecutionInfo()
Returns information on the execution of this query.

The returned object includes basic information such as the queried hosts, but also the Cassandra query trace if tracing was enabled for the query.

Returns:
the execution info for this query.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.