|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.func.Conversions
public class Conversions
Functions for converting between strings and numeric values.
Method Summary | |
---|---|
static int |
fromHex(String hexVal)
Converts a string representing a hexadecimal number to its integer value. |
static byte |
parseByte(String str)
Attempts to interpret a string as a byte (8-bit signed integer) value. |
static double |
parseDouble(String str)
Attempts to interpret a string as a double (64-bit signed integer) value. |
static float |
parseFloat(String str)
Attempts to interpret a string as a float (32-bit floating point) value. |
static int |
parseInt(String str)
Attempts to interpret a string as an int (32-bit signed integer) value. |
static long |
parseLong(String str)
Attempts to interpret a string as a long (64-bit signed integer) value. |
static short |
parseShort(String str)
Attempts to interpret a string as a short (16-bit signed integer) value. |
static byte |
toByte(double value)
Attempts to convert the numeric argument to a byte (8-bit signed integer) result. |
static double |
toDouble(double value)
Converts the numeric argument to a double (64-bit signed integer) result. |
static float |
toFloat(double value)
Attempts to convert the numeric argument to a float (32-bit floating point) result. |
static String |
toHex(long value)
Converts the integer argument to hexadecimal form. |
static int |
toInteger(double value)
Attempts to convert the numeric argument to an int (32-bit signed integer) result. |
static long |
toLong(double value)
Attempts to convert the numeric argument to a long (64-bit signed integer) result. |
static short |
toShort(double value)
Attempts to convert the numeric argument to a short (16-bit signed integer) result. |
static String |
toString(double value)
Turns a numeric value into a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String toString(double value)
value
- numeric value
value
public static byte parseByte(String str)
str
- string containing numeric representation
str
public static short parseShort(String str)
str
- string containing numeric representation
str
public static int parseInt(String str)
str
- string containing numeric representation
str
public static long parseLong(String str)
str
- string containing numeric representation
str
public static float parseFloat(String str)
str
- string containing numeric representation
str
public static double parseDouble(String str)
str
- string containing numeric representation
str
public static byte toByte(double value)
value
- numeric value for conversion
value
converted to type bytepublic static short toShort(double value)
value
- numeric value for conversion
value
converted to type shortpublic static int toInteger(double value)
value
- numeric value for conversion
value
converted to type intpublic static long toLong(double value)
value
- numeric value for conversion
value
converted to type longpublic static float toFloat(double value)
value
- numeric value for conversion
value
converted to type floatpublic static double toDouble(double value)
value
- numeric value for conversion
value
converted to type doublepublic static String toHex(long value)
value
- integer value
value
toHex(42) = "2a"
public static int fromHex(String hexVal)
hexVal
- hexadecimal representation of value
hexVal
fromHex("2a") = 42
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |