java.lang.Object
org.gcube.informationsystem.resourceregistry.statistics.Distribution

public class Distribution extends Object
Average, median and maximum of a set of counts, as the public statistics show them.
Author:
Luca Frosini (ISTI - CNR)
  • Constructor Details

    • Distribution

      public Distribution(Collection<Integer> values)
      Parameters:
      values - the counts, in any order
  • Method Details

    • round

      public static double round(double value)
      Rounds a figure to two decimals.
      Parameters:
      value - the figure
      Returns:
      the figure rounded half up to two decimals
    • average

      public double average()
      Returns:
      the average, rounded to two decimals; 0 with no value
    • median

      public double median()
      Returns:
      the median; 0 with no value
    • max

      public int max()
      Returns:
      the maximum; 0 with no value