public class GetObjectsByLocatorsOperation extends RankingSingleQueryOperation
QueryOperation.DataEqualOperation
AbstractOperation.OperationConstructor, AbstractOperation.OperationName
suppData, uuidOperationComparator
Constructor and Description |
---|
GetObjectsByLocatorsOperation()
Create a new instance of GetObjectsByLocatorsOperation with an empty locators set.
|
GetObjectsByLocatorsOperation(java.lang.Iterable<?> locators)
Create a new instance of GetObjectsByLocatorsOperation with the specified locators.
|
GetObjectsByLocatorsOperation(java.lang.Iterable<?> locators,
LocalAbstractObject queryObjectForDistances)
Create a new instance of GetObjectsByLocatorsOperation with the specified locators.
|
GetObjectsByLocatorsOperation(java.lang.Iterable<?> locators,
LocalAbstractObject queryObjectForDistances,
AnswerType answerType)
Create a new instance of GetObjectsByLocatorsOperation with the specified locators.
|
GetObjectsByLocatorsOperation(java.lang.Iterable<?> locators,
LocalAbstractObject queryObjectForDistances,
AnswerType answerType,
int maxAnswerSize)
Create a new instance of GetObjectsByLocatorsOperation with the specified locators.
|
GetObjectsByLocatorsOperation(LocalAbstractObject queryObjectForDistances,
AnswerType answerType)
Create a new instance of GetObjectsByLocatorsOperation with empty locators set.
|
GetObjectsByLocatorsOperation(LocalAbstractObject queryObjectForDistances,
AnswerType answerType,
int maxAnswerCount)
Create a new instance of GetObjectsByLocatorsOperation with empty locators set.
|
GetObjectsByLocatorsOperation(LocalAbstractObject queryObjectForDistances,
int maxAnswerCount)
Create a new instance of GetObjectsByLocatorsOperation with empty locators set.
|
Modifier and Type | Method and Description |
---|---|
void |
addLocator(java.lang.String locator)
Add a locator to this query.
|
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.Class<? extends RankedAbstractObject> |
getAnswerClass()
Returns the class of objects this operation stores in its answer.
|
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.
|
java.util.Set<java.lang.String> |
getLocators()
Returns the object locators this query searches for.
|
boolean |
hasLocator(java.lang.String locator)
Check whether the set of locators contains given locator.
|
static java.util.Set<java.lang.String> |
objectsToLocatorsCollection(java.lang.Iterable<?> objects)
Converts a collection of objects (either
AbstractObject or String s)
into a collection of (their) locator URIs. |
void |
setLocators(java.lang.Iterable<?> locators)
Replace the current locators of this query with the provided collection.
|
addToAnswer, addToAnswer, clearSurplusData, clone, createOperation, getQueryObject, isStoringMetaDistances
addToAnswer, endOperation, getAnswer, getAnswer, 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
public GetObjectsByLocatorsOperation(java.lang.Iterable<?> locators, LocalAbstractObject queryObjectForDistances, AnswerType answerType, int maxAnswerSize)
locators
- the collection of locators to be foundqueryObjectForDistances
- the query object to use for computing distancesanswerType
- the type of objects this operation stores in its answermaxAnswerSize
- the limit for the number of objects kept in this operation's answerpublic GetObjectsByLocatorsOperation(java.lang.Iterable<?> locators, LocalAbstractObject queryObjectForDistances, AnswerType answerType)
locators
- the collection of locators to be foundqueryObjectForDistances
- the query object to use for computing distancesanswerType
- the type of objects this operation stores in its answerpublic GetObjectsByLocatorsOperation(java.lang.Iterable<?> locators, LocalAbstractObject queryObjectForDistances)
locators
- the collection of locators to be foundqueryObjectForDistances
- the query object to use for computing distancespublic GetObjectsByLocatorsOperation(java.lang.Iterable<?> locators)
locators
- the collection of locators to search forpublic GetObjectsByLocatorsOperation()
public GetObjectsByLocatorsOperation(LocalAbstractObject queryObjectForDistances, AnswerType answerType, int maxAnswerCount)
queryObjectForDistances
- the query object to use for computing distancesanswerType
- the type of objects this operation stores in its answermaxAnswerCount
- the limit for the number of objects kept in this operation's answerpublic GetObjectsByLocatorsOperation(LocalAbstractObject queryObjectForDistances, AnswerType answerType)
queryObjectForDistances
- the query object to use for computing distancesanswerType
- the type of objects this operation stores in its answerpublic GetObjectsByLocatorsOperation(LocalAbstractObject queryObjectForDistances, int maxAnswerCount)
queryObjectForDistances
- the query object to use for computing distancesmaxAnswerCount
- the limit for the number of objects kept in this operation's answerpublic static java.util.Set<java.lang.String> objectsToLocatorsCollection(java.lang.Iterable<?> objects)
AbstractObject
or String
s)
into a collection of (their) locator URIs.
Note that if the given collection is null, an empty set is returned.
For a collection of AbstractObject
s, the method AbstractObject.getLocatorURI()
is used to extract the locator. Otherwise, the Object.toString()
is
used on the objects to obtain the locator.objects
- the iterator of objects to get the locators forpublic 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 java.util.Set<java.lang.String> getLocators()
public void addLocator(java.lang.String locator)
locator
- the locator to be addedpublic void setLocators(java.lang.Iterable<?> locators)
locators
- the new collection of locatorspublic boolean hasLocator(java.lang.String locator)
locator
- the locator to be checkedtrue
if the set of locators to be found contains the given locator
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 queryjava.lang.IllegalArgumentException
- if the object cannot be added to the answer, e.g. because it cannot be clonedpublic java.lang.Class<? extends RankedAbstractObject> getAnswerClass()
getAnswerClass
in class RankingQueryOperation
protected boolean dataEqualsImpl(QueryOperation obj)
QueryOperation
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()
QueryOperation
dataHashCode
in class QueryOperation<RankedAbstractObject>