messif.operations.query
Class GetAllObjectsQueryOperation

java.lang.Object
  extended by messif.operations.AbstractOperation
      extended by messif.operations.QueryOperation<AbstractObject>
          extended by messif.operations.ListingQueryOperation
              extended by messif.operations.query.GetAllObjectsQueryOperation
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Clearable

public class GetAllObjectsQueryOperation
extends ListingQueryOperation

Operation for retrieving all objects locally stored (organized by an algorithm). Is is usually applied to centralized algorithms only.

See Also:
Serialized Form

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
GetAllObjectsQueryOperation()
          Creates a new instance of GetAllObjectsQuery.
GetAllObjectsQueryOperation(AnswerType answerType)
          Creates a new instance of GetAllObjectsQuery.
 
Method Summary
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
addToAnswer, 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

GetAllObjectsQueryOperation

public GetAllObjectsQueryOperation()
Creates a new instance of GetAllObjectsQuery. Stored objects will be NoDataObject.


GetAllObjectsQueryOperation

public GetAllObjectsQueryOperation(AnswerType answerType)
Creates a new instance of GetAllObjectsQuery.

Parameters:
answerType - the type of objects this operation stores in its answer
Method Detail

getArgument

public java.lang.Object getArgument(int index)
                             throws java.lang.IndexOutOfBoundsException
Returns argument that was passed while constructing instance. If the argument is not stored within operation, null is returned.

Overrides:
getArgument in class AbstractOperation
Parameters:
index - index of an argument passed to constructor
Returns:
argument that was passed while constructing instance
Throws:
java.lang.IndexOutOfBoundsException - if index parameter is out of range

getArgumentCount

public int getArgumentCount()
Returns number of arguments that were passed while constructing this instance.

Overrides:
getArgumentCount in class AbstractOperation
Returns:
number of arguments that were passed while constructing this instance

evaluate

public int evaluate(AbstractObjectIterator<? extends LocalAbstractObject> objects)
Evaluate this query on a given set of objects. The objects found by this evaluation are added to answer of this query via ListingQueryOperation.addToAnswer(messif.objects.AbstractObject).

Specified by:
evaluate in class QueryOperation<AbstractObject>
Parameters:
objects - the collection of objects on which to evaluate this query
Returns:
number of objects satisfying the query

dataEqualsImpl

protected boolean dataEqualsImpl(AbstractOperation obj)
Indicates whether some other operation has the same data as this one.

Specified by:
dataEqualsImpl in class AbstractOperation
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object has the same data as the obj argument; false otherwise.

dataHashCode

public int dataHashCode()
Returns a hash code value for the data of this operation.

Specified by:
dataHashCode in class AbstractOperation
Returns:
a hash code value for the data of this operation