Class RecommMetricGridReader

java.lang.Object
es.uam.eps.ir.relison.grid.GridReader
es.uam.eps.ir.relison.grid.links.recommendation.metrics.RecommMetricGridReader

public class RecommMetricGridReader
extends GridReader
Class for reading contact recommendation metrics.. For each metric, a grid of parameters is read.
File format:
metrics:
metric_name:
param1: ...
See Also:
GridReader
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private static java.lang.String METRICS  
    private java.util.Map<java.lang.String,​Grid> metricsGrid
    Metrics grid.
  • Constructor Summary

    Constructors 
    Constructor Description
    RecommMetricGridReader()
    Constructor
  • Method Summary

    Modifier and Type Method Description
    Grid getGrid​(java.lang.String algorithm)
    Gets the grid for a given algorithm
    java.util.Set<java.lang.String> getMetrics()
    Gets the set of algorithms previously read.
    void read​(java.util.Map<java.lang.String,​java.lang.Object> map)
    Obtains the different grids for contact recommendation metrics.
    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 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)
      Obtains the different grids for contact recommendation metrics.
      Parameters:
      map - a map containing the information in the YAML file about the different metrics.
    • readMetric

      private void readMetric​(java.util.Map.Entry<java.lang.String,​java.lang.Object> element)
      Reads the grid for a single metric.
      Parameters:
      element - a map containing the information in the YAML file about the metric.
    • getMetrics

      public java.util.Set<java.lang.String> getMetrics()
      Gets the set of algorithms previously read.
      Returns:
      The set of algorithms previously read from the grid file.
    • getGrid

      public Grid getGrid​(java.lang.String algorithm)
      Gets the grid for a given algorithm
      Parameters:
      algorithm - the algorithm to search
      Returns:
      the grid if exists, an empty grid if not.