Class RecommMetricConfigurationsReader

java.lang.Object
es.uam.eps.ir.relison.grid.ConfigurationsReader
es.uam.eps.ir.relison.grid.links.recommendation.metrics.RecommMetricConfigurationsReader

public class RecommMetricConfigurationsReader
extends ConfigurationsReader
Class for reading contact recommendation metrics. For each metric, it reads a list of configurations.
File format:
metrics:
metric_name:
- param1: ...
param2: ...
- param1: ...
...
See Also:
ConfigurationsReader
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private java.util.Map<java.lang.String,​Configurations> metricConfs
    Map for storing the different configurations of a metric.
    private static java.lang.String METRICS  
  • Constructor Summary

    Constructors 
    Constructor Description
    RecommMetricConfigurationsReader()
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    Configurations getConfigurations​(java.lang.String algorithm)
    Gets the different configurations for a single metric.
    java.util.Set<java.lang.String> getMetrics()
    Once the configurations have been read, it obtains the set of metrics 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 metrics.
    private void readMetrics​(java.util.Map.Entry<java.lang.String,​java.lang.Object> element)
    Reads the configurations for a single metric.

    Methods inherited from class es.uam.eps.ir.relison.grid.ConfigurationsReader

    readConfigurationGrid

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • 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 metrics.
      Parameters:
      map - the map containing the metric configurations.
    • readMetrics

      private void readMetrics​(java.util.Map.Entry<java.lang.String,​java.lang.Object> element)
      Reads the configurations for a single metric.
      Parameters:
      element - an object containing the configurations for a single metric.
    • getMetrics

      public java.util.Set<java.lang.String> getMetrics()
      Once the configurations have been read, it obtains the set of metrics which have been read from the file. Otherwise, it returns an empty set.
      Returns:
      a set containing the names of the metrics in the configuration file.
    • getConfigurations

      public Configurations getConfigurations​(java.lang.String algorithm)
      Gets the different configurations for a single metric.
      Parameters:
      algorithm - the name of the metric.
      Returns:
      the configurations for the given metric if exists, an empty list of configurations otherwise.