|
||||||||||
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.ListingQueryOperation
messif.operations.query.GetRandomObjectsQueryOperation
public class GetRandomObjectsQueryOperation
Operation for retriving a list of random objects.
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 | |
---|---|
GetRandomObjectsQueryOperation(int count)
Creates a new instance of GetRandomObjecstQueryOperation. |
|
GetRandomObjectsQueryOperation(int count,
AnswerType answerType)
Creates a new instance of GetRandomObjectsQueryOperation. |
Method Summary | |
---|---|
boolean |
addToAnswer(AbstractObject object)
Add an object to the answer. |
protected boolean |
dataEqualsImpl(AbstractOperation obj)
Indicates whether some other operation has the same data as this one. |
int |
dataHashCode()
Returns a hash code value for the data of this operation. |
int |
evaluate(AbstractObjectIterator<? extends LocalAbstractObject> objects)
Evaluate this query on a given set of objects. |
java.lang.Object |
getArgument(int index)
Returns argument that was passed while constructing instance. |
int |
getArgumentCount()
Returns number of arguments that were passed while constructing this instance. |
Methods inherited from class messif.operations.ListingQueryOperation |
---|
clearSurplusData, clone, getAnswer, getAnswer, getAnswerClass, getAnswerCount, getAnswerObjects, resetAnswer, updateFrom, updateFrom, updateFrom, updateFrom |
Methods inherited from class messif.operations.QueryOperation |
---|
appendErrorCode, endOperation, getAnswerType, wasSuccessful |
Methods inherited from class messif.operations.AbstractOperation |
---|
appendArguments, createOperation, dataEquals, endOperation, equals, getAnnotatedConstructor, getAnnotatedConstructor, getConstructorArgumentDescriptions, getConstructorArgumentDescriptions, getConstructorArguments, getConstructorArguments, getConstructorDescription, getErrorCode, getName, getName, getOperationID, hashCode, isFinished, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GetRandomObjectsQueryOperation(int count)
AnswerType.NODATA_OBJECTS
will be returned in the result.
count
- the number of random objects to retrievepublic GetRandomObjectsQueryOperation(int count, AnswerType answerType)
count
- the number of random objects to retrieveanswerType
- the type of objects this operation stores in its answerMethod Detail |
---|
public java.lang.Object getArgument(int index) throws java.lang.IndexOutOfBoundsException
AbstractOperation
getArgument
in class AbstractOperation
index
- zero-based index of an argument passed to constructor
java.lang.IndexOutOfBoundsException
- if index parameter is out of rangepublic int getArgumentCount()
AbstractOperation
getArgumentCount
in class AbstractOperation
public int evaluate(AbstractObjectIterator<? extends LocalAbstractObject> objects)
QueryOperation
evaluate
in class QueryOperation<AbstractObject>
objects
- the collection of objects on which to evaluate this query
public boolean addToAnswer(AbstractObject object) throws java.lang.IllegalArgumentException
ListingQueryOperation
QueryOperation.answerType
.
addToAnswer
in class ListingQueryOperation
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 clonnedprotected boolean dataEqualsImpl(AbstractOperation obj)
AbstractOperation
dataEqualsImpl
in class AbstractOperation
obj
- the reference object with which to compare.
true
if this object has the same data as the obj
argument; false
otherwise.public int dataHashCode()
AbstractOperation
dataHashCode
in class AbstractOperation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |