Class LongStatistic

  • All Implemented Interfaces:
    Statistic

    public class LongStatistic
    extends AbstractStatistic
    Trivial long-valued statistic.
    Since:
    0.6.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) long value
      Statistic value.
    • Constructor Summary

      Constructors 
      Constructor Description
      LongStatistic​(java.lang.String key)
      Constructor.
      LongStatistic​(java.lang.String key, long value)
      Constructor.
    • Field Detail

      • value

        long value
        Statistic value.
    • Constructor Detail

      • LongStatistic

        public LongStatistic​(java.lang.String key)
        Constructor.
        Parameters:
        key - Key
      • LongStatistic

        public LongStatistic​(java.lang.String key,
                             long value)
        Constructor.
        Parameters:
        key - Key
        value - Value
    • Method Detail

      • setLong

        public LongStatistic setLong​(long value)
        Set the statistics.
        Parameters:
        value - New value
        Returns:
        this for chaining
      • increment

        public LongStatistic increment​(long inc)
        Increment counter.
        Parameters:
        inc - Increment
        Returns:
        this for chaining
      • formatValue

        public java.lang.String formatValue()
        Description copied from interface: Statistic
        Get a formatted version of the value, for output.
        Returns:
        Value