Package uk.ac.starlink.ttools.plot
Class Rounder
java.lang.Object
uk.ac.starlink.ttools.plot.Rounder
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract 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.
-
Field Details
-
LINEAR
Number rounder for linear scaling. All values are >0. -
LOG
Number rounder for logarithmic scaling. All values are >1. -
TIME_SECOND
Number rounder for time intervals in seconds. All values are >0.
-
-
Constructor Details
-
Rounder
public Rounder()
-
-
Method Details
-
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.- Parameters:
value
- input value- Returns:
- round number a bit smaller than the given value
-