Class AggregatedValueObject


  • class AggregatedValueObject
    extends java.lang.Object
    Aggregated value object stores aggregated measurements for provided set of data. The purpose of aggregation is to avoid high memory and processor time requirements for the calculation of statistics.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long count  
      private long max  
      private double mean  
      private long min  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private AggregatedValueObject​(long max, long min, double mean, long count)  
    • Field Detail

      • max

        private final long max
      • min

        private final long min
      • mean

        private final double mean
      • count

        private final long count
    • Constructor Detail

      • AggregatedValueObject

        private AggregatedValueObject​(long max,
                                      long min,
                                      double mean,
                                      long count)
    • Method Detail

      • createFromValues

        public static AggregatedValueObject createFromValues​(java.util.Collection<java.lang.Long> values)
        Creates aggregated value object for monitoring statistics based on the provided values. During the construction, the values collection must not be modified.
        Parameters:
        values - The collection to create the aggregated statistics from.
        Returns:
        Aggregated value object for provided arguments.
      • createFromMultiValues

        public static AggregatedValueObject createFromMultiValues​(java.util.Collection<? extends java.util.Collection<java.lang.Long>> values)
        Creates aggregated value object for monitoring statistics based on the provided collection of values. During the construction, the values collection must not be modified.
        Parameters:
        values - The collection to create the aggregated statistics from.
        Returns:
        Aggregated value object for provided arguments.
      • getMax

        public long getMax()
        Returns:
        The maximum value of the aggregated data
      • getMin

        public long getMin()
        Returns:
        The minimum value of the aggregated data
      • getMean

        public double getMean()
        Returns:
        The mean of the aggregated data
      • getCount

        public long getCount()
        Returns:
        The total number of the values this aggregated data provide information about