Class IndividualSamplingAlgorithmGridReader
java.lang.Object
es.uam.eps.ir.relison.grid.ParametersReader
es.uam.eps.ir.relison.grid.links.recommendation.sampling.IndividualSamplingAlgorithmGridReader
public class IndividualSamplingAlgorithmGridReader extends ParametersReader
Reads the grid for sampling algorithms from a YAML file.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
SAMPLERS
String for identifying the samplers in the file:private java.util.Map<java.lang.String,Parameters>
samplersGrid
Algorithms grid. -
Constructor Summary
Constructors Constructor Description IndividualSamplingAlgorithmGridReader()
Constructor. -
Method Summary
Modifier and Type Method Description java.util.Set<java.lang.String>
getIndividualSamplingAlgorithms()
Gets the set of algorithms previously read.Parameters
getParameters(java.lang.String algorithm)
Gets the grid for a given algorithm.void
read(java.util.Map<java.lang.String,java.lang.Object> map)
Reads a YAML document containing a grid.private void
readIndividualSamplingAlgorithm(java.util.Map.Entry<java.lang.String,java.lang.Object> element)
Reads the grid for a single algorithm.Methods inherited from class es.uam.eps.ir.relison.grid.ParametersReader
readBoolean, readDouble, readInteger, readLong, readOrientation, readParameters, readParameterValues, readString
-
Field Details
-
SAMPLERS
private static final java.lang.String SAMPLERSString for identifying the samplers in the file:- See Also:
- Constant Field Values
-
samplersGrid
Algorithms grid. Uses a grid for each algorithm.
-
-
Constructor Details
-
IndividualSamplingAlgorithmGridReader
public IndividualSamplingAlgorithmGridReader()Constructor.
-
-
Method Details
-
read
public void read(java.util.Map<java.lang.String,java.lang.Object> map)Reads a YAML document containing a grid.- Parameters:
map
- a map containing the grid information.
-
readIndividualSamplingAlgorithm
private void readIndividualSamplingAlgorithm(java.util.Map.Entry<java.lang.String,java.lang.Object> element)Reads the grid for a single algorithm.- Parameters:
element
- the YAML element containing the algorithm information.
-
getIndividualSamplingAlgorithms
public java.util.Set<java.lang.String> getIndividualSamplingAlgorithms()Gets the set of algorithms previously read.- Returns:
- the set of algorithms previously read from the grid file.
-
getParameters
Gets the grid for a given algorithm.- Parameters:
algorithm
- the algorithm to search.- Returns:
- the grid if exists, an empty grid if not.
-