|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.gora.query.impl.ResultBase<K,T>
public abstract class ResultBase<K,T extends Persistent>
Base class for Result implementations.
| Field Summary | |
|---|---|
protected DataStore<K,T> |
dataStore
|
protected K |
key
|
protected long |
limit
Query limit |
protected long |
offset
How far we have proceeded |
protected T |
persistent
|
protected Query<K,T> |
query
|
| Constructor Summary | |
|---|---|
ResultBase(DataStore<K,T> dataStore,
Query<K,T> query)
|
|
| Method Summary | |
|---|---|
protected void |
clear()
|
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. |
protected T |
getOrCreatePersistent(T persistent)
|
Class<T> |
getPersistentClass()
Returns the class of the persistent objects |
Query<K,T> |
getQuery()
Returns the Query object for this Result. |
protected boolean |
isLimitReached()
Returns whether the limit for the query is reached. |
boolean |
next()
Advances to the next element and returns false if at end. |
protected abstract boolean |
nextInner()
next() calls this function to read the
actual results. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.gora.query.Result |
|---|
close, getProgress |
| Field Detail |
|---|
protected final DataStore<K,T extends Persistent> dataStore
protected final Query<K,T extends Persistent> query
protected K key
protected T extends Persistent persistent
protected long limit
protected long offset
| Constructor Detail |
|---|
public ResultBase(DataStore<K,T> dataStore,
Query<K,T> query)
| Method Detail |
|---|
public DataStore<K,T> getDataStore()
Result
getDataStore in interface Result<K,T extends Persistent>public Query<K,T> getQuery()
Result
getQuery in interface Result<K,T extends Persistent>public T get()
Result
get in interface Result<K,T extends Persistent>public K getKey()
Result
getKey in interface Result<K,T extends Persistent>public Class<K> getKeyClass()
Result
getKeyClass in interface Result<K,T extends Persistent>public Class<T> getPersistentClass()
Result
getPersistentClass in interface Result<K,T extends Persistent>protected boolean isLimitReached()
protected void clear()
public final boolean next()
throws IOException
Result
next in interface Result<K,T extends Persistent>IOExceptionpublic long getOffset()
Result
getOffset in interface Result<K,T extends Persistent>
protected abstract boolean nextInner()
throws IOException
next() calls this function to read the
actual results.
IOException
protected T getOrCreatePersistent(T persistent)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||