public class MultiQueryWrapperAlgorithm extends Algorithm
RankingMultiQueryOperation
s by executing
multiple single-object queries and add them to the result.Algorithm.AlgorithmConstructor
log, maximalConcurrentOperations
Constructor and Description |
---|
MultiQueryWrapperAlgorithm(Algorithm algorithm,
java.lang.Class<? extends QueryOperation<?>> singleQueryOperationClass,
java.lang.String... operationParameters)
Creates a new multi-object query wrapper algorithm.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroy this algorithm.
|
void |
finalize()
Finalize the algorithm.
|
Algorithm |
getAlgorithm()
Returns the encapsulated algorithm.
|
void |
processMultiObjectOperation(RankingMultiQueryOperation op)
Implementation of multi-object query operation.
|
void |
processOperation(AbstractOperation op)
Implementation of a generic operation.
|
afterStoreToFile, backgroundExecuteOperation, backgroundExecuteOperationIndependent, backgroundExecuteOperationWithStatistics, beforeStoreToFile, createBackgroundExecutionCallable, execute, executeMethodWithStringArguments, executeOperation, executeUsingNavDir, getAllRunningOperations, getAnnotatedConstructors, getAnnotatedConstructorsArray, getConstructorArgumentDescriptions, getConstructorDescription, getConstructorDescriptionSimple, getExecutorParamClasses, getFirstSupportedOperation, getName, getObjectClass, getObjectCount, getOperationStatistics, getOperationsThreadPool, getOperationSubClasses, getQueryAnswer, getQueryAnswer, getRunningOperationById, getRunningOperationsCount, getSupportedOperations, getSupportedOperations, methodExecute, resetOperationStatistics, restoreFromFile, restoreFromFile, setExecutedOperationsLogVerbosity, setOperationsThreadPool, setupStatsAndExecuteOperation, statisticsAfterOperation, statisticsBeforeOperation, storeToFile, terminateOperation, terminateOperation, waitBackgroundExecution
public MultiQueryWrapperAlgorithm(Algorithm algorithm, java.lang.Class<? extends QueryOperation<?>> singleQueryOperationClass, java.lang.String... operationParameters) throws java.lang.IllegalArgumentException, java.lang.NoSuchMethodException
algorithm
- the encapsulated algorithm that handles regular queriessingleQueryOperationClass
- the single-object query operation class that is used while evaluating the multi-object queryoperationParameters
- the additional parameters (starting from the second one, the first one is always the query object)
for the single-object query operationjava.lang.NoSuchMethodException
- if the single-query operation constructor was not found for the given number of argumentsjava.lang.IllegalArgumentException
public void finalize() throws java.lang.Throwable
Algorithm
public void destroy() throws java.lang.Throwable
Algorithm
This implementation defaults to call Algorithm.finalize()
, but should be overridden
if the algorithm needs to differentiate between finalizing and destroying. In that case
the "super.destroy()" should not be called if finalizing is not part of destroy.
public Algorithm getAlgorithm()
public void processMultiObjectOperation(RankingMultiQueryOperation op) throws AlgorithmMethodException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.InterruptedException, java.lang.InstantiationException, java.lang.IllegalAccessException
op
- the generic operation to executeAlgorithmMethodException
- if the operation execution on the encapsulated algorithm has thrown an exceptionjava.lang.NoSuchMethodException
- if the operation is unsupported by the encapsulated algorithmjava.lang.reflect.InvocationTargetException
- if the specified operation cannot be created for the given parametersjava.lang.InterruptedException
- if the computation has been interrupted while processingjava.lang.InstantiationException
- if the single-query operation cannot be createdjava.lang.IllegalAccessException
- if the single-query operation constructors is not accessiblepublic void processOperation(AbstractOperation op) throws AlgorithmMethodException, java.lang.NoSuchMethodException
op
- the generic operation to executeAlgorithmMethodException
- if the operation execution on the encapsulated algorithm has thrown an exceptionjava.lang.NoSuchMethodException
- if the operation is unsupported by the encapsulated algorithm