Package es.uam.eps.ir.relison.grid.sna
Class MetricParametersReader
java.lang.Object
es.uam.eps.ir.relison.grid.ParametersReader
es.uam.eps.ir.relison.grid.sna.MetricParametersReader
public class MetricParametersReader extends ParametersReader
Class for reading social network analysis metrics.
For each metric, a single set of parameters is read.
File format:
metrics:
metric_name:
type: value
params:
param1: ...
File format:
metrics:
metric_name:
type: value
params:
param1: ...
- See Also:
ParametersReader
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
METRICS
Identifier for the metrics.private java.util.Map<java.lang.String,java.util.Map<java.lang.String,Parameters>>
metricsGrid
A map containing the different configurations for each metric.private static java.lang.String
PARAMS
Identifier for the metric type.private static java.lang.String
TYPE
Identifier for the metric type. -
Constructor Summary
Constructors Constructor Description MetricParametersReader()
Constructor. -
Method Summary
Modifier and Type Method Description Parameters
getGrid(java.lang.String metric, java.lang.String type)
Once the metrics have been read, it obtains the grid for a single one.java.util.Set<java.lang.String>
getMetrics(java.lang.String type)
Once the metrics have been read, it obtains the set of metrics of a given type which have been retrieved from the file.void
read(java.util.Map<java.lang.String,java.lang.Object> map)
It reads the YAML document containing the data.private void
readMetric(java.util.Map.Entry<java.lang.String,java.lang.Object> element)
Reads the grid for a single metric.Methods inherited from class es.uam.eps.ir.relison.grid.ParametersReader
readBoolean, readDouble, readInteger, readLong, readOrientation, readParameters, readParameterValues, readString
-
Field Details
-
METRICS
private static final java.lang.String METRICSIdentifier for the metrics.- See Also:
- Constant Field Values
-
TYPE
private static final java.lang.String TYPEIdentifier for the metric type.- See Also:
- Constant Field Values
-
PARAMS
private static final java.lang.String PARAMSIdentifier for the metric type.- See Also:
- Constant Field Values
-
metricsGrid
private final java.util.Map<java.lang.String,java.util.Map<java.lang.String,Parameters>> metricsGridA map containing the different configurations for each metric. It is indexed by the name of the metric.
-
-
Constructor Details
-
MetricParametersReader
public MetricParametersReader()Constructor.
-
-
Method Details
-
read
public void read(java.util.Map<java.lang.String,java.lang.Object> map)It reads the YAML document containing the data.- Parameters:
map
- the map containing the metric parameters.
-
readMetric
private void readMetric(java.util.Map.Entry<java.lang.String,java.lang.Object> element)Reads the grid for a single metric.- Parameters:
element
- the YAML element containing the information about the metric.
-
getMetrics
public java.util.Set<java.lang.String> getMetrics(java.lang.String type)Once the metrics have been read, it obtains the set of metrics of a given type which have been retrieved from the file.- Parameters:
type
- the type of metric.- Returns:
- the set of metrics of the given metric which have been retrieved.
-
getGrid
Once the metrics have been read, it obtains the grid for a single one.- Parameters:
metric
- the name of the metric.type
- the type of metric.- Returns:
- the set of metrics of the given metric which have been retrieved.
-