public abstract class RankingSingleQueryOperation extends RankingQueryOperation
QueryOperation.DataEqualOperation
AbstractOperation.OperationConstructor, AbstractOperation.OperationName
suppData, uuidOperationComparator
Modifier | Constructor and Description |
---|---|
protected |
RankingSingleQueryOperation(LocalAbstractObject queryObject)
Creates a new instance of RankingSingleQueryOperation.
|
protected |
RankingSingleQueryOperation(LocalAbstractObject queryObject,
AnswerType answerType,
boolean storeMetaDistances)
Creates a new instance of RankingSingleQueryOperation.
|
protected |
RankingSingleQueryOperation(LocalAbstractObject queryObject,
AnswerType answerType,
int maxAnswerSize)
Creates a new instance of RankingSingleQueryOperation.
|
protected |
RankingSingleQueryOperation(LocalAbstractObject queryObject,
AnswerType answerType,
int maxAnswerSize,
boolean storeMetaDistances)
Creates a new instance of RankingSingleQueryOperation.
|
protected |
RankingSingleQueryOperation(LocalAbstractObject queryObject,
AnswerType answerType,
RankedSortedCollection answerCollection,
boolean storeMetaDistances)
Creates a new instance of RankingSingleQueryOperation.
|
protected |
RankingSingleQueryOperation(LocalAbstractObject queryObject,
int maxAnswerSize)
Creates a new instance of RankingSingleQueryOperation.
|
Modifier and Type | Method and Description |
---|---|
RankedAbstractObject |
addToAnswer(LocalAbstractObject object)
Adds an object to the answer.
|
RankedAbstractObject |
addToAnswer(LocalAbstractObject object,
float distThreshold)
Adds an object to the answer.
|
void |
clearSurplusData()
Clear non-messif data stored in operation.
|
RankingSingleQueryOperation |
clone(boolean preserveAnswer)
Create a duplicate of this operation.
|
static <E extends RankingSingleQueryOperation> |
createOperation(java.lang.Class<E> operationClass,
LocalAbstractObject queryObject,
java.lang.Object... arguments)
Creates a new ranking single-query operation of the specified class.
|
LocalAbstractObject |
getQueryObject()
Returns the single object that the answer is ranked to.
|
boolean |
isStoringMetaDistances()
Returns true if sub-distances for metaobjects are stored in the answer.
|
addToAnswer, endOperation, getAnswer, getAnswer, getAnswerClass, getAnswerCollectionClass, getAnswerCollectionClone, getAnswerComparator, getAnswerCount, getAnswerDistance, getAnswerDistanceRestricted, getAnswerDistanceRestricted, getAnswerMaximalCapacity, getAnswerObjects, getAnswerThreshold, getLastAnswer, getSubAnswer, getSubAnswer, getSubAnswerCount, isAnswerFull, resetAnswer, setAnswerCollection, setAnswerIgnoringDuplicates, setAnswerThresholdComputation, setAnswerThresholdComputation, updateFrom, updateFrom
appendErrorCode, clone, dataEquals, dataEqualsImpl, dataHashCode, endOperation, evaluate, getAllSubAnswers, getAnswerType, getQueryAnswer, iterator, setAnswerType, wasSuccessful
appendArguments, containsParameter, createOperation, equals, getAnnotatedConstructor, getAnnotatedConstructor, getArgument, getArgumentCount, getArgumentString, getConstructorArgumentDescriptions, getConstructorArgumentDescriptions, getConstructorArguments, getConstructorArguments, getConstructorDescription, getErrorCode, getName, getName, getOperationID, getParameter, getParameter, getParameter, getParameterCount, getParameterMap, getParameterNames, getRequiredParameter, getRequiredParameter, hashCode, isErrorCode, isFinished, removeParameter, setParameter, toString
protected RankingSingleQueryOperation(LocalAbstractObject queryObject)
changed to no-data objects
.
Unlimited number of objects can be added to the answer.queryObject
- the query object for this operationprotected RankingSingleQueryOperation(LocalAbstractObject queryObject, int maxAnswerSize) throws java.lang.IllegalArgumentException
changed to no-data objects
.queryObject
- the query object for this operationmaxAnswerSize
- sets the maximal answer sizejava.lang.IllegalArgumentException
- if the maximal answer size is negativeprotected RankingSingleQueryOperation(LocalAbstractObject queryObject, AnswerType answerType, int maxAnswerSize) throws java.lang.IllegalArgumentException
queryObject
- the query object for this operationanswerType
- the type of objects this operation stores in its answermaxAnswerSize
- sets the maximal answer sizejava.lang.IllegalArgumentException
- if the maximal answer size is negativeprotected RankingSingleQueryOperation(LocalAbstractObject queryObject, AnswerType answerType, boolean storeMetaDistances) throws java.lang.IllegalArgumentException
queryObject
- the query object for this operationanswerType
- the type of objects this operation stores in its answerstoreMetaDistances
- if true, all processed meta objects
will
store their sub-distances
in the answerjava.lang.IllegalArgumentException
- if the maximal answer size is negativeprotected RankingSingleQueryOperation(LocalAbstractObject queryObject, AnswerType answerType, int maxAnswerSize, boolean storeMetaDistances) throws java.lang.IllegalArgumentException
queryObject
- the query object for this operationanswerType
- the type of objects this operation stores in its answermaxAnswerSize
- sets the maximal answer sizestoreMetaDistances
- if true, all processed meta objects
will
store their sub-distances
in the answerjava.lang.IllegalArgumentException
- if the maximal answer size is negativeprotected RankingSingleQueryOperation(LocalAbstractObject queryObject, AnswerType answerType, RankedSortedCollection answerCollection, boolean storeMetaDistances)
queryObject
- the query object for this operationanswerType
- the type of objects this operation stores in its answeranswerCollection
- collection to be used as answer (it must be empty, otherwise it will be cleared)storeMetaDistances
- if true, all processed meta objects
will
store their sub-distances
in the answerjava.lang.NullPointerException
- if the passed collection is null
public LocalAbstractObject getQueryObject()
public boolean isStoringMetaDistances()
public RankingSingleQueryOperation clone(boolean preserveAnswer) throws java.lang.CloneNotSupportedException
QueryOperation
preserveAnswer
is true the answer is
not cloned but both this and the cloned operation share the same answer collection.clone
in class RankingQueryOperation
preserveAnswer
- flag whether to clone the answer (false) or preserve
the same answer collection (true) in the cloned operationjava.lang.CloneNotSupportedException
- if the operation instance cannot be clonedpublic void clearSurplusData()
clearSurplusData
in interface Clearable
clearSurplusData
in class AbstractOperation
public RankedAbstractObject addToAnswer(LocalAbstractObject object, float distThreshold)
query object
and the specified object.object
- the object to adddistThreshold
- the threshold on distance;
if the computed distance exceeds the threshold (sharply),
the object is not added to the answerpublic RankedAbstractObject addToAnswer(LocalAbstractObject object)
query object
and the specified object.object
- the object to addpublic static <E extends RankingSingleQueryOperation> E createOperation(java.lang.Class<E> operationClass, LocalAbstractObject queryObject, java.lang.Object... arguments) throws java.lang.NoSuchMethodException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException
E
- the class of the operation that should be createdoperationClass
- the class of the operation that should be createdqueryObject
- the query object for the operationarguments
- arguments supplied to the constructor; they should match the types of getConstructorArguments(operationClass)java.lang.NoSuchMethodException
- if either the operationClass
is null or the class is not annotated using AbstractOperation.OperationName
java.lang.IllegalArgumentException
- if the argument count or their types don't match the specified operation class constructorjava.lang.reflect.InvocationTargetException
- if there was an exception in the operation's constructor