Class Count

java.lang.Object
uk.ac.starlink.topcat.Count

public abstract class Count extends Object
Utility class for handling positive integers. Useful if you want to reference many instances of small values, and not so many of large ones; this implementation caches the small ones, and creates the large ones on demand.
Since:
3 Feb 2015
Author:
Mark Taylor
  • Method Details

    • getValue

      public abstract long getValue()
      Returns the numeric value of this count.
      Returns:
      count value
    • getCount

      public static Count getCount(long lval)
      Obtains an instance of this class for a given value.
      Parameters:
      lval - value
      Returns:
      instance
    • increment

      public static Count increment(Count in)
      Returns the next count instance in sequence. As a special case, an input null value is treated as a count with value zero.
      Parameters:
      in - input value, or null
      Returns:
      count for in+1