|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
uk.ac.starlink.ast.gui.AstDouble
public class AstDouble
AstDouble implements a double precision Number that represents a value that should be formatted and unformatted using the characteristics of an axis of an AST Frame. This allows it to be encoded and decoded as say RA and Dec, as well as more mundane types such as simple double precision.
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()).
Field Summary | |
---|---|
static double |
BAD
The AST bad value. |
Constructor Summary | |
---|---|
AstDouble(double value,
Frame frame,
int axis)
Construct an AstDouble. |
|
AstDouble(String value,
Frame frame,
int axis)
Construct an AstDouble from a formatted value. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double BAD
Constructor Detail |
---|
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
Method Detail |
---|
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()
toString
in class Object
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)
s
- 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 static AstDouble valueOf(String value, Frame frame, int axis)
s
- 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 byte byteValue()
byteValue
in class Number
public double doubleValue()
doubleValue
in class Number
public float floatValue()
floatValue
in class Number
public int intValue()
intValue
in class Number
public long longValue()
longValue
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.java.lang.Double.compareTo()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |