uk.ac.starlink.topcat
Class Count

java.lang.Object
  extended by 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 Summary
static Count getCount(long lval)
          Obtains an instance of this class for a given value.
abstract  long getValue()
          Returns the numeric value of this count.
static Count increment(Count in)
          Returns the next count instance in sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.