|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.operations.AbstractOperation
messif.operations.QueryOperation<RankedAbstractObject>
messif.operations.RankingQueryOperation
messif.operations.query.KNNMultiQueryOperation
public class KNNMultiQueryOperation
K-nearest neighbors query operation with multiple query objects.
Retrieves k
objects that are nearest to the specified query objects
(according to the distance measure).
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 | |
---|---|
KNNMultiQueryOperation(java.util.Collection<LocalAbstractObject> queryObjects,
int k)
Creates a new instance of kNNQueryOperation for given query objects and maximal number of objects to return. |
|
KNNMultiQueryOperation(java.util.Collection<LocalAbstractObject> queryObjects,
int k,
AnswerType answerType)
Creates a new instance of kNNQueryOperation for given query objects and maximal number of objects to return. |
|
KNNMultiQueryOperation(java.util.Collection<LocalAbstractObject> queryObjects,
int k,
boolean storeMetaDistances,
AnswerType answerType)
Creates a new instance of kNNQueryOperation for given query objects and maximal number of objects to return. |
Method Summary | |
---|---|
void |
clearSurplusData()
Clear non-messif data stored in operation. |
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. |
int |
getK()
Returns the number of nearest objects to retrieve. |
LocalAbstractObject[] |
getQueryObjects()
Returns the query objects of this operation. |
Methods inherited from class messif.operations.RankingQueryOperation |
---|
addToAnswer, addToAnswer, clone, getAnswer, getAnswer, getAnswerClass, getAnswerCount, getAnswerDistance, getAnswerObjects, getAnswerThreshold, getLastAnswer, isAnswerFull, isStoringMetaDistances, resetAnswer, setAnswerCollection, 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 KNNMultiQueryOperation(java.util.Collection<LocalAbstractObject> queryObjects, int k)
no-data objects
.
queryObjects
- the objects to which the nearest neighbors are searchedk
- the number of nearest neighbors to retrievepublic KNNMultiQueryOperation(java.util.Collection<LocalAbstractObject> queryObjects, int k, AnswerType answerType)
queryObjects
- the objects to which the nearest neighbors are searchedk
- the number of nearest neighbors to retrieveanswerType
- the type of objects this operation stores in its answerpublic KNNMultiQueryOperation(java.util.Collection<LocalAbstractObject> queryObjects, int k, boolean storeMetaDistances, AnswerType answerType)
queryObjects
- the objects to which the nearest neighbors are searchedk
- the number of nearest neighbors to retrievestoreMetaDistances
- if true, all processed meta objects
will
store their sub-distances
in the answeranswerType
- the type of objects this operation stores in its answerMethod Detail |
---|
public LocalAbstractObject[] getQueryObjects()
public int getK()
public java.lang.Object getArgument(int index) throws java.lang.IndexOutOfBoundsException
getArgument
in class AbstractOperation
index
- index of an argument passed to constructor
java.lang.IndexOutOfBoundsException
- if index parameter is out of rangepublic int getArgumentCount()
getArgumentCount
in class AbstractOperation
public int evaluate(AbstractObjectIterator<? extends LocalAbstractObject> objects)
RankingQueryOperation.addToAnswer(messif.objects.LocalAbstractObject, messif.objects.LocalAbstractObject, float)
.
evaluate
in class QueryOperation<RankedAbstractObject>
objects
- the collection of objects on which to evaluate this query
public void clearSurplusData()
clearSurplusData
in interface Clearable
clearSurplusData
in class RankingQueryOperation
protected boolean dataEqualsImpl(AbstractOperation obj)
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()
dataHashCode
in class AbstractOperation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |