Class RerankerConfigurationsReader
java.lang.Object
es.uam.eps.ir.relison.grid.ConfigurationsReader
es.uam.eps.ir.relison.grid.links.recommendation.rerankers.RerankerConfigurationsReader
public class RerankerConfigurationsReader extends ConfigurationsReader
Class for reading reranking algorithms.
For each algorithm, it reads a list of configurations.
File format:
rerankers:
reranker:
- param1: ...
param2: ...
- param1: ...
...
File format:
rerankers:
reranker:
- param1: ...
param2: ...
- param1: ...
...
- See Also:
ConfigurationsReader
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
RERANKERS
private java.util.Map<java.lang.String,Configurations>
rerankersConfs
Map for storing the different configurations of an algorithm. -
Constructor Summary
Constructors Constructor Description RerankerConfigurationsReader()
Constructor. -
Method Summary
Modifier and Type Method Description Configurations
getConfigurations(java.lang.String algorithm)
Gets the different configurations for a single algorithm.java.util.Set<java.lang.String>
getRerankers()
Once the configurations have been read, it obtains the set of rerankers which have been read from the file.void
read(java.util.Map<java.lang.String,java.lang.Object> map)
Reads a YAML document containing the different configurations of a list of rerankers.private void
readAlgorithm(java.util.Map.Entry<java.lang.String,java.lang.Object> element)
Reads the configurations for a single algorithm.
-
Field Details
-
RERANKERS
private static final java.lang.String RERANKERS- See Also:
- Constant Field Values
-
rerankersConfs
Map for storing the different configurations of an algorithm.
-
-
Constructor Details
-
RerankerConfigurationsReader
public RerankerConfigurationsReader()Constructor.
-
-
Method Details
-
read
public void read(java.util.Map<java.lang.String,java.lang.Object> map)Reads a YAML document containing the different configurations of a list of rerankers.- Parameters:
map
- the map containing the configurations for the rerankers.
-
readAlgorithm
private void readAlgorithm(java.util.Map.Entry<java.lang.String,java.lang.Object> element)Reads the configurations for a single algorithm.- Parameters:
element
- an object containing the configurations for a single algorithm.
-
getRerankers
public java.util.Set<java.lang.String> getRerankers()Once the configurations have been read, it obtains the set of rerankers which have been read from the file. Otherwise, it returns an empty set.- Returns:
- a set containing the names of the rerankers in the configuration file.
-
getConfigurations
Gets the different configurations for a single algorithm.- Parameters:
algorithm
- the name of the reranker.- Returns:
- the configurations for the given reranker if exists, an empty list of configurations otherwise.
-