public abstract class ResultBase<K,T extends Persistent> extends Object implements Result<K,T>
Result implementations.| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
ResultBase(DataStore<K,T> dataStore,
Query<K,T> query) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clear() |
void |
close() |
protected boolean |
filter(K key,
T persistent) |
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProgressprotected 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
public DataStore<K,T> getDataStore()
ResultgetDataStore in interface Result<K,T extends Persistent>public Query<K,T> getQuery()
ResultgetQuery in interface Result<K,T extends Persistent>public T get()
Resultget in interface Result<K,T extends Persistent>public K getKey()
ResultgetKey in interface Result<K,T extends Persistent>public Class<K> getKeyClass()
ResultgetKeyClass in interface Result<K,T extends Persistent>public Class<T> getPersistentClass()
ResultgetPersistentClass in interface Result<K,T extends Persistent>protected boolean isLimitReached()
protected void clear()
public final boolean next()
throws Exception,
IOException
Resultnext in interface Result<K,T extends Persistent>ExceptionIOExceptionpublic long getOffset()
ResultgetOffset in interface Result<K,T extends Persistent>protected abstract boolean nextInner()
throws IOException
next() calls this function to read the
actual results.IOExceptionprotected T getOrCreatePersistent(T persistent) throws Exception, IOException
ExceptionIOExceptionpublic void close()
throws IOException
close in interface Result<K,T extends Persistent>IOExceptionCopyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.