public class Conversions
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static int |
fromHex(java.lang.String hexVal) |
Converts a string representing a hexadecimal number to its
integer value.
|
static byte |
parseByte(java.lang.String str) |
Attempts to interpret a string as a byte (8-bit signed integer) value.
|
static double |
parseDouble(java.lang.String str) |
Attempts to interpret a string as a double (64-bit signed integer) value.
|
static float |
parseFloat(java.lang.String str) |
Attempts to interpret a string as a float (32-bit floating point) value.
|
static int |
parseInt(java.lang.String str) |
Attempts to interpret a string as an int (32-bit signed integer) value.
|
static long |
parseLong(java.lang.String str) |
Attempts to interpret a string as a long (64-bit signed integer) value.
|
static short |
parseShort(java.lang.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 java.lang.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 java.lang.String |
toString(boolean booleanVal) |
Turns a boolean value into a string.
|
static java.lang.String |
toString(byte byteVal) |
Turns a byte value into a string.
|
static java.lang.String |
toString(char charVal) |
Turns a single character value into a string.
|
static java.lang.String |
toString(double fpVal) |
Turns a numeric value into a string.
|
static java.lang.String |
toString(long intVal) |
Turns an integer numeric value into a string.
|
static java.lang.String |
toString(java.lang.Object objVal) |
Turns any object value into a string.
|
public static java.lang.String toString(double fpVal)
fpVal - floating point numeric valuefpValpublic static java.lang.String toString(long intVal)
intVal - integer numeric valueintValpublic static java.lang.String toString(char charVal)
charVal - character numeric valuecharValpublic static java.lang.String toString(byte byteVal)
byteVal - byte numeric valuebyteValpublic static java.lang.String toString(boolean booleanVal)
booleanVal - boolean value (true or false)booleanVal
("true" or "false")public static java.lang.String toString(java.lang.Object objVal)
toString
to any object value without knowing its type
and get a useful return from it.objVal - non-primitive valueobjValpublic static byte parseByte(java.lang.String str)
str - string containing numeric representationstrpublic static short parseShort(java.lang.String str)
str - string containing numeric representationstrpublic static int parseInt(java.lang.String str)
str - string containing numeric representationstrpublic static long parseLong(java.lang.String str)
str - string containing numeric representationstrpublic static float parseFloat(java.lang.String str)
str - string containing numeric representationstrpublic static double parseDouble(java.lang.String str)
str - string containing numeric representationstrpublic static byte toByte(double value)
value - numeric value for conversionvalue converted to type bytepublic static short toShort(double value)
value - numeric value for conversionvalue converted to type shortpublic static int toInteger(double value)
value - numeric value for conversionvalue converted to type intpublic static long toLong(double value)
value - numeric value for conversionvalue converted to type longpublic static float toFloat(double value)
value - numeric value for conversionvalue converted to type floatpublic static double toDouble(double value)
value - numeric value for conversionvalue converted to type doublepublic static java.lang.String toHex(long value)
value - integer valuevaluetoHex(42) = "2a"public static int fromHex(java.lang.String hexVal)
hexVal - hexadecimal representation of valuehexValfromHex("2a") = 42Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.