public class Hexagesimal
extends java.lang.Number
implements java.util.Formattable
In addition, this class provides methods for converting a double to a String and a String to a double in a hexagesimal notation and support for formatting with Formatter class.
Constructor and Description |
---|
Hexagesimal(double value)
Create initialized instance
|
Modifier and Type | Method and Description |
---|---|
byte |
byteValue()
Returns the value of this
Hexagesimal as an byte (by casting to type byte). |
double |
doubleValue()
Returns the value of this
Hexagesimal object. |
float |
floatValue()
Returns the value of this
Hexagesimal as an float (by casting to type float). |
void |
formatTo(java.util.Formatter formatter,
int flags,
int width,
int precision)
Implements formatTo() method of Formattable interface.
|
int |
intValue()
Returns the value of this
Hexagesimal as an int (by casting to type int). |
long |
longValue()
Returns the value of this
Hexagesimal as an long (by casting to type long). |
short |
shortValue()
Returns the value of this
Hexagesimal as an short (by casting to type short). |
java.lang.String |
toString()
Returns a hexagesimal string representation of the object.
|
static java.lang.String |
toString(double value)
Returns a hexagesimal string representation of the argument.
|
static java.lang.String |
toString(double value,
int flags,
int width,
int precision)
Returns a hexagesimal string representation of the argument.
|
static Hexagesimal |
valueOf(java.lang.String string)
Returns a
Hexagesimal object holding the double value represented by the argument
hexagesimal string. |
public Hexagesimal(double value)
value
- the value to be represented by the Hexagesimal
.public int intValue()
Hexagesimal
as an int (by casting to type int).intValue
in class java.lang.Number
public long longValue()
Hexagesimal
as an long (by casting to type long).longValue
in class java.lang.Number
public float floatValue()
Hexagesimal
as an float (by casting to type float).floatValue
in class java.lang.Number
public byte byteValue()
Hexagesimal
as an byte (by casting to type byte).byteValue
in class java.lang.Number
public short shortValue()
Hexagesimal
as an short (by casting to type short).shortValue
in class java.lang.Number
public double doubleValue()
Hexagesimal
object.doubleValue
in class java.lang.Number
public void formatTo(java.util.Formatter formatter, int flags, int width, int precision)
Use ALTERNATE flag for HMS or DMS separators instead of spaces
Use UPPERCASE flag for HMS separators instead of DMS separators
formatTo
in interface java.util.Formattable
public static Hexagesimal valueOf(java.lang.String string)
Hexagesimal
object holding the double value represented by the argument
hexagesimal string.string
- the string to be parsed.Hexagesimal
object holding the value represented by the argument.public static java.lang.String toString(double value, int flags, int width, int precision)
value
- the double to be converted.flags
- flags corresponding to FormattableFlags.
Use ALTERNATE flag for HMS or DMS separators instead of spaces
Use UPPERCASE flag for HMS separators instead of DMS separators
width
- the minimum number of characters to be written to the output. If the length of the
converted value is less than the width then the output will be padded by ' ' until the
total number of characters equals width. The padding is at the beginning.precision
- the precision of seconds field.public static java.lang.String toString(double value)
value
- the double to be converted.DD MM SS.SS
format.public java.lang.String toString()
toString
in class java.lang.Object
value
- the double to be converted.DD MM SS.SS
format.