uk.ac.starlink.ttools.plot
Class Rounder

java.lang.Object
  extended by uk.ac.starlink.ttools.plot.Rounder

public abstract class Rounder
extends Object

Provides round numbers. Static instances are provided for rounding numbers to be used in a linear or a logarithmic context.

Since:
18 Nov 2005
Author:
Mark Taylor

Field Summary
static Rounder LINEAR
          Number rounder for linear scaling.
static Rounder LOG
          Number rounder for logarithmic scaling.
 
Constructor Summary
Rounder()
           
 
Method Summary
abstract  double nextDown(double value)
          Returns the next round number smaller than the given value.
abstract  double nextUp(double value)
          Returns the next round number larger than the given value.
abstract  double round(double value)
          Returns a round number near the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINEAR

public static final Rounder LINEAR
Number rounder for linear scaling. All values are >0.


LOG

public static final Rounder LOG
Number rounder for logarithmic scaling. All values are >1.

Constructor Detail

Rounder

public Rounder()
Method Detail

round

public abstract double round(double value)
Returns a round number near the given value.

Parameters:
value - input value
Returns:
round number near value

nextUp

public abstract double nextUp(double value)
Returns the next round number larger than the given value.

Parameters:
value - input value
Returns:
round number a bit larger than value

nextDown

public abstract double nextDown(double value)
Returns the next round number smaller than the given value.

Returns:
value input value


Copyright © 2009 Central Laboratory of the Research Councils. All Rights Reserved.