This project has retired. For details please refer to its Attic page.
Result (Apache Gora 0.2 API)

org.apache.gora.query
Interface Result<K,T extends Persistent>

All Superinterfaces:
Closeable
All Known Implementing Classes:
AccumuloResult, AvroResult, CassandraResult, DataFileAvroResult, HBaseGetResult, HBaseResult, HBaseScannerResult, MemStore.MemResult, ResultBase, SqlResult

public interface Result<K,T extends Persistent>
extends Closeable

A result to a Query. Objects in the result set can be iterated by calling next(), get() and getKey().


Method Summary
 void close()
           
 T get()
          Returns the current object.
 DataStore<K,T> getDataStore()
          Returns the DataStore, that this Result is associated with.
 K getKey()
          Returns the current key.
 Class<K> getKeyClass()
          Returns the class of the keys
 long getOffset()
          Returns the number of times next() is called with return value true.
 Class<T> getPersistentClass()
          Returns the class of the persistent objects
 float getProgress()
          Returns how far along the result has iterated, a value between 0 and 1.
 Query<K,T> getQuery()
          Returns the Query object for this Result.
 boolean next()
          Advances to the next element and returns false if at end.
 

Method Detail

getDataStore

DataStore<K,T> getDataStore()
Returns the DataStore, that this Result is associated with.

Returns:
the DataStore of the Result

getQuery

Query<K,T> getQuery()
Returns the Query object for this Result.

Returns:
the Query object for this Result.

next

boolean next()
             throws IOException
Advances to the next element and returns false if at end.

Returns:
true if end is not reached yet
Throws:
IOException

getKey

K getKey()
Returns the current key.

Returns:
current key

get

T get()
Returns the current object.

Returns:
current object

getKeyClass

Class<K> getKeyClass()
Returns the class of the keys

Returns:
class of the keys

getPersistentClass

Class<T> getPersistentClass()
Returns the class of the persistent objects

Returns:
class of the persistent objects

getOffset

long getOffset()
Returns the number of times next() is called with return value true.

Returns:
the number of results so far

getProgress

float getProgress()
                  throws IOException
Returns how far along the result has iterated, a value between 0 and 1.

Throws:
IOException

close

void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.