public abstract class ResultWSBase<K,T extends Persistent> extends Object implements Result<K,T>
Result implementations.| Modifier and Type | Field and Description |
|---|---|
protected DataStore<K,T> |
dataStore
Data store used
|
protected K |
key
Key
|
protected long |
limit
Query limit
|
protected long |
offset
How far we have proceeded
|
protected T |
persistent
Persistent object
|
protected Query<K,T> |
query
Query for obtaining this result
|
| Constructor and Description |
|---|
ResultWSBase(DataStore<K,T> dataStore,
Query<K,T> query)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
clear()
Clears the persistent object
|
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)
Creates an object if it does not exists
|
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, waitclose, getProgressprotected 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
Resultpublic long getOffset()
ResultgetOffset in interface Result<K,T extends Persistent>protected abstract boolean nextInner()
throws Exception
next() calls this function to read the
actual results.Exceptionprotected T getOrCreatePersistent(T persistent) throws Exception, IOException
persistent - Object to be created if it does not existExceptionIOExceptionCopyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.