|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.operations.AbstractOperation
messif.operations.QueryOperation<AbstractObject>
messif.operations.SingletonQueryOperation
public abstract class SingletonQueryOperation
The base class for query operations that return a single object
.
These are, for example, operations that retrieve objects by ID or locator.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class messif.operations.AbstractOperation |
---|
AbstractOperation.DataEqualOperation, AbstractOperation.OperationConstructor, AbstractOperation.OperationName |
Field Summary |
---|
Fields inherited from class messif.operations.QueryOperation |
---|
answerType |
Fields inherited from class messif.operations.AbstractOperation |
---|
errValue, operID, suppData |
Constructor Summary | |
---|---|
protected |
SingletonQueryOperation()
Creates a new instance of SingletonQueryOperation. |
protected |
SingletonQueryOperation(AnswerType answerType)
Creates a new instance of ListingQueryOperation. |
Method Summary | |
---|---|
boolean |
addToAnswer(AbstractObject object)
Add an object to the answer. |
void |
clearSurplusData()
Clear non-messif data stored in operation. |
SingletonQueryOperation |
clone()
Create a duplicate of this operation. |
java.util.Iterator<AbstractObject> |
getAnswer()
Returns an iterator over all objects in the answer to this query. |
java.util.Iterator<AbstractObject> |
getAnswer(int skip,
int count)
Returns an iterator over all objects in the answer skipping the first skip items and returning only count elements. |
java.lang.Class<? extends AbstractObject> |
getAnswerClass()
Returns the class of objects this operation stores in its answer. |
int |
getAnswerCount()
Returns the number of objects in this query answer. |
AbstractObject |
getAnswerObject()
Returns an object that is the answer to this query. |
java.util.Iterator<AbstractObject> |
getAnswerObjects()
Returns an iterator over all AbstractObject s in the answer to this query. |
void |
resetAnswer()
Reset the current query answer. |
void |
updateFrom(AbstractOperation operation)
Update the error code and answer of this operation from another operation. |
Methods inherited from class messif.operations.QueryOperation |
---|
appendErrorCode, endOperation, evaluate, getAnswerType, wasSuccessful |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected SingletonQueryOperation()
cleared and clonned
.
protected SingletonQueryOperation(AnswerType answerType)
answerType
- the type of object this operation stores in its answerMethod Detail |
---|
public SingletonQueryOperation clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractOperation
java.lang.CloneNotSupportedException
- if the operation instance cannot be clonedpublic java.lang.Class<? extends AbstractObject> getAnswerClass()
getAnswerClass
in class QueryOperation<AbstractObject>
public int getAnswerCount()
getAnswerCount
in class QueryOperation<AbstractObject>
public java.util.Iterator<AbstractObject> getAnswer()
getAnswer
in class QueryOperation<AbstractObject>
public java.util.Iterator<AbstractObject> getAnswer(int skip, int count)
QueryOperation
skip
items and returning only count
elements. If count
is less than or equal to zero, all objects from the answer (except for
skip
) are returned.
getAnswer
in class QueryOperation<AbstractObject>
skip
- number of answer objects to skipcount
- number of answer objects to iterate (maximally, actual number of results can be smaller)
public java.util.Iterator<AbstractObject> getAnswerObjects()
QueryOperation
AbstractObject
s in the answer to this query.
This method unwraps the objects from the results.
getAnswerObjects
in class QueryOperation<AbstractObject>
AbstractObject
s in the answer to this querypublic AbstractObject getAnswerObject()
public boolean addToAnswer(AbstractObject object) throws java.lang.IllegalArgumentException
QueryOperation.answerType
.
object
- the object to add
true
if the object
has been added to the answer. Otherwise false
.
java.lang.IllegalArgumentException
- if the object cannot be added to the answer, e.g. because it cannot be clonnedpublic void resetAnswer()
resetAnswer
in class QueryOperation<AbstractObject>
public void updateFrom(AbstractOperation operation) throws java.lang.IllegalArgumentException
updateFrom
in class AbstractOperation
operation
- the source operation from which to get the update
java.lang.IllegalArgumentException
- if the answer of the specified operation is incompatible with this onepublic void clearSurplusData()
clearSurplusData
in interface Clearable
clearSurplusData
in class AbstractOperation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |