Class ParallelLinearRetrieverImpl
java.lang.Object
de.uni_trier.wi2.procake.utils.composition.FactoryObjectImplementation
de.uni_trier.wi2.procake.utils.composition.AbstractEmptyFactoryObjectImplementation
de.uni_trier.wi2.procake.retrieval.impl.RetrieverImpl<DataObject,Query>
de.uni_trier.wi2.procake.retrieval.impl.ParallelLinearRetrieverImpl
- All Implemented Interfaces:
ParallelLinearRetriever<DataObject,
,Query> RetrievalFactoryObject
,Retriever<DataObject,
Query>
public class ParallelLinearRetrieverImpl
extends RetrieverImpl<DataObject,Query>
implements ParallelLinearRetriever<DataObject,Query>, RetrievalFactoryObject
-
Field Summary
Fields inherited from interface de.uni_trier.wi2.procake.retrieval.ParallelLinearRetriever
DEFAULT_NUMBER_OF_WORKERS, DEFAULT_SORTING, DEFAULT_TASK_SIZE
Fields inherited from interface de.uni_trier.wi2.procake.retrieval.Retriever
DEFAULT_ADDQUERYTORESULTS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Each retriever must have an unique name.int
boolean
Performs a retrieval for the given query.void
setNumberOfWorkers
(int numberOfWorkers) Set the number of parallel worker threads performing retrieval tasksvoid
setSorting
(boolean sorting) Determines whether queue should be sorted before retrieval or not.void
setTaskSize
(int taskSize) Sets the size of a single retrieval task.Methods inherited from class de.uni_trier.wi2.procake.retrieval.impl.RetrieverImpl
getInternalSimilarityMeasure, getObjectPool, getSimilarityModel, getValuator, isAddQueryToResults, newQuery, setAddQueryToResults, setInternalSimilarityMeasure, setObjectPool, setSimilarityModel
Methods inherited from class de.uni_trier.wi2.procake.utils.composition.AbstractEmptyFactoryObjectImplementation
getParameters, postInit, preInit
Methods inherited from class de.uni_trier.wi2.procake.utils.composition.FactoryObjectImplementation
getParameter, initParametersBasedOn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.uni_trier.wi2.procake.retrieval.Retriever
getValuator, isAddQueryToResults, newQuery, setAddQueryToResults, setInternalSimilarityMeasure, setObjectPool, setSimilarityModel
-
Constructor Details
-
ParallelLinearRetrieverImpl
public ParallelLinearRetrieverImpl()
-
-
Method Details
-
getNumberOfWorkers
public int getNumberOfWorkers()- Specified by:
getNumberOfWorkers
in interfaceParallelLinearRetriever<DataObject,
Query> - Returns:
- number of workers
-
setNumberOfWorkers
public void setNumberOfWorkers(int numberOfWorkers) Description copied from interface:ParallelLinearRetriever
Set the number of parallel worker threads performing retrieval tasks- Specified by:
setNumberOfWorkers
in interfaceParallelLinearRetriever<DataObject,
Query> - Parameters:
numberOfWorkers
- number of parallel retrieval tasks
-
setTaskSize
public void setTaskSize(int taskSize) Description copied from interface:ParallelLinearRetriever
Sets the size of a single retrieval task.- Specified by:
setTaskSize
in interfaceParallelLinearRetriever<DataObject,
Query> - Parameters:
taskSize
- size of a single retrieval task
-
getTaskSize
public int getTaskSize()- Specified by:
getTaskSize
in interfaceParallelLinearRetriever<DataObject,
Query> - Returns:
- size of a single retrieval task
-
setSorting
public void setSorting(boolean sorting) Description copied from interface:ParallelLinearRetriever
Determines whether queue should be sorted before retrieval or not.- Specified by:
setSorting
in interfaceParallelLinearRetriever<DataObject,
Query> - Parameters:
sorting
- true, if queue should be sorted before retrieval
-
isSorting
public boolean isSorting()- Specified by:
isSorting
in interfaceParallelLinearRetriever<DataObject,
Query> - Returns:
- flag, if queue should be sorted before retrieval
-
perform
Description copied from interface:Retriever
Performs a retrieval for the given query.- Specified by:
perform
in interfaceRetriever<DataObject,
Query> - Parameters:
query
- A query that can be created withRetriever.newQuery()
- Returns:
- a list of retrieval results
-
getRetrieverName
Description copied from interface:RetrievalFactoryObject
Each retriever must have an unique name. This name gan be used to get a new retriever instance from the factory.- Specified by:
getRetrieverName
in interfaceRetrievalFactoryObject
- Returns:
- Returns the name of the retriever.
-