public class AstDouble extends Number implements Comparable
This transformation is achieved using the "format" and "unformat" AST routines. Failures to decode a string are signalled by the value of this object being equivalent to BAD (i.e. test isBad()).
Modifier and Type | Field and Description |
---|---|
static double |
BAD
The AST bad value.
|
Constructor and Description |
---|
AstDouble(double value,
Frame frame,
int axis)
Construct an AstDouble.
|
AstDouble(String value,
Frame frame,
int axis)
Construct an AstDouble from a formatted value.
|
Modifier and Type | Method and Description |
---|---|
byte |
byteValue() |
int |
compareTo(Object o)
Compares this AstDouble to another Object.
|
double |
doubleValue() |
float |
floatValue() |
int |
intValue() |
boolean |
isBad()
Check if this object is BAD (i.e.
|
static boolean |
isBad(double value)
Check if a value is BAD (i.e.
|
long |
longValue() |
static double |
parseDouble(String value,
Frame frame,
int axis)
Returns a new double initialized to the value represented by
the specified String.
|
short |
shortValue() |
String |
toString()
Return a String representation of this object.
|
static String |
toString(double value,
Frame frame,
int axis)
Return a formatted String representation of a double.
|
AstDouble |
valueOf(String value)
Creates a new AstDouble object by initializing to the value
represented by the specified string.
|
static AstDouble |
valueOf(String value,
Frame frame,
int axis)
Returns a new AstDouble object initialized to the value
represented by the specified string.
|
public static final double BAD
public AstDouble(double value, Frame frame, int axis)
value
- the value to be stored.frame
- a reference to an AST frame whose properties
define the axis formatting and unformatting
capabilities. This may be a frameset or plot, in
which case it applies to the current frame.axis
- the axis in the frameset that should be used.public AstDouble(String value, Frame frame, int axis) throws NumberFormatException
value
- the value to be unformatted and stored.frame
- a reference to an AST frame whose properties
define the axis formatting and unformatting
capabilities. This may be a frameset or plot, in
which case it applies to the current frame.axis
- the axis in the frameset that should be used.NumberFormatException
public boolean isBad()
public static boolean isBad(double value)
value
- the value to compare.public static double parseDouble(String value, Frame frame, int axis)
value
- the string to be parsed.frame
- a reference to an AST frame whose properties
define the axis formatting and unformatting
capabilities. This may be a frameset or plot, in
which case it applies to the current frame.axis
- the axis in the frameset that should be used.public String toString()
public static String toString(double value, Frame frame, int axis)
value
- the value to be formatted.frame
- a reference to an AST frame whose properties
define the axis formatting and unformatting
capabilities. This may be a frameset or plot, in
which case it applies to the current frame.axis
- the axis in the frameset that should be used.public AstDouble valueOf(String value)
value
- the string to be parsed.public static AstDouble valueOf(String value, Frame frame, int axis)
value
- the string to be parsed.frame
- a reference to an AST frame whose properties
define the axis formatting and unformatting
capabilities. This may be a frameset or plot, in
which case it applies to the current frame.axis
- the axis in the frameset that should be used.public double doubleValue()
doubleValue
in class Number
public float floatValue()
floatValue
in class Number
public short shortValue()
shortValue
in class Number
public int compareTo(Object o)
compareTo
in interface Comparable
o
- the Object to be compared.ClassCastException
- if the argument is not an AstDouble.Double.compareTo(java.lang.Double)
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.