public class AggregationFunctionQueryOperation extends RankingSingleQueryOperation
k
objects (metaobjects) from any
storage using the AggregationFunction
function to evalute the
distance between the query object and the objects stored.MetaObject
,
AggregationFunction
,
Serialized FormQueryOperation.DataEqualOperation
AbstractOperation.OperationConstructor, AbstractOperation.OperationName
Modifier and Type | Field and Description |
---|---|
protected AggregationFunction |
aggregationFunction
Threshold function for measuring the overall similarity
|
protected int |
k
Number of nearest (top) objects to retrieve
|
suppData, uuidOperationComparator
Constructor and Description |
---|
AggregationFunctionQueryOperation(LocalAbstractObject queryObject,
int k,
AggregationFunction aggregationFunction)
Creates a new instance of AggregationFunctionQueryOperation.
|
AggregationFunctionQueryOperation(LocalAbstractObject queryObject,
int k,
AggregationFunction aggregationFunction,
AnswerType answerType,
boolean storeMetaDistances)
Creates a new instance of AggregationFunctionQueryOperation.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
dataEqualsImpl(QueryOperation 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.
|
int |
getK()
Returns the number of nearest (top) objects to retrieve.
|
MetaObject |
getQueryObject()
Returns the query (meta) object of this query operation.
|
AggregationFunction |
getThresholdFunction()
Returns the threshold function for measuring the overall similarity.
|
addToAnswer, addToAnswer, clearSurplusData, clone, createOperation, isStoringMetaDistances
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, endOperation, getAllSubAnswers, getAnswerType, getQueryAnswer, iterator, setAnswerType, wasSuccessful
appendArguments, containsParameter, createOperation, equals, getAnnotatedConstructor, getAnnotatedConstructor, 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 final int k
protected final AggregationFunction aggregationFunction
public AggregationFunctionQueryOperation(LocalAbstractObject queryObject, int k, AggregationFunction aggregationFunction)
MetaObject
to make the agg. function meaningful
The parameter names for the aggregation should match the names in the MetaObject
.queryObject
- the query objectk
- the number of results to retrieveaggregationFunction
- the aggregation function for combining the distances from sorted listspublic AggregationFunctionQueryOperation(LocalAbstractObject queryObject, int k, AggregationFunction aggregationFunction, AnswerType answerType, boolean storeMetaDistances)
MetaObject
to make the agg. function meaningful
The parameter names for the aggregation should match the names in the MetaObject
.queryObject
- the query objectk
- the number of results to retrieveaggregationFunction
- the aggregation function for combining the distances from sorted listsanswerType
- the type of objects this operation stores in its answerstoreMetaDistances
- if true, all processed meta objects
willpublic java.lang.Object getArgument(int index) throws java.lang.IndexOutOfBoundsException
getArgument
in class AbstractOperation
index
- index of an argument passed to constructorjava.lang.IndexOutOfBoundsException
- if index parameter is out of rangepublic int getArgumentCount()
getArgumentCount
in class AbstractOperation
public MetaObject getQueryObject()
getQueryObject
in class RankingSingleQueryOperation
public int getK()
public AggregationFunction getThresholdFunction()
public int evaluate(AbstractObjectIterator<? extends LocalAbstractObject> objects)
RankingSingleQueryOperation.addToAnswer(messif.objects.LocalAbstractObject, float)
.evaluate
in class QueryOperation<RankedAbstractObject>
objects
- the collection of objects on which to evaluate this queryprotected boolean dataEqualsImpl(QueryOperation obj)
dataEqualsImpl
in class QueryOperation<RankedAbstractObject>
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()
dataHashCode
in class QueryOperation<RankedAbstractObject>