|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.plumtree.openfoundation.util.XPConvert
public class XPConvert
Converts a base data type to another base data type. For the purposes of string-number parsing and formatting, always uses the default locale's decimal point (".").
Constructor Summary | |
---|---|
XPConvert()
|
Method Summary | |
---|---|
static boolean |
ToBoolean(boolean val)
Returns the specified boolean value; no actual conversion is performed. |
static boolean |
ToBoolean(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to an equivalent boolean value. |
static boolean |
ToBoolean(char val)
Calling this method always throws XPFormatException. |
static boolean |
ToBoolean(double val)
Converts the value of the specified double (double-precision floating point number) to an equivalent boolean value. |
static boolean |
ToBoolean(float val)
Converts the value of the specified float (single-precision floating point number) to an equivalent boolean value. |
static boolean |
ToBoolean(int val)
Converts the value of the specified int (32-bit signed integer) to an equivalent boolean value. |
static boolean |
ToBoolean(long val)
Converts the value of the specified long (64-bit signed integer) to an equivalent Boolean value. |
static boolean |
ToBoolean(java.lang.Object val)
Converts the value of a specified Object to an equivalent boolean value. |
static boolean |
ToBoolean(short val)
Converts the value of the specified short (16-bit signed integer) to an equivalent boolean value. |
static boolean |
ToBoolean(java.lang.String val)
Converts the specified String representation of a logical value to its boolean equivalent. |
static byte |
ToByte(boolean val)
Converts the value of the specified boolean value to the equivalent byte (8-bit unsigned integer). |
static byte |
ToByte(byte val)
Returns the specified byte (8-bit unsigned integer); no actual conversion is performed. |
static byte |
ToByte(char val)
Converts the value of the specified Unicode character to the equivalent byte (8-bit unsigned integer). |
static byte |
ToByte(double val)
Converts the value of the specified double (double-precision floating point number) to an equivalent byte (8-bit unsigned integer). |
static byte |
ToByte(float val)
Converts the value of the specified float (single-precision floating point number) to an equivalent byte (8-bit unsigned integer). |
static byte |
ToByte(int val)
Converts the value of the specified int (32-bit signed integer) to an equivalent byte (8-bit unsigned integer). |
static byte |
ToByte(long val)
Converts the value of the specified long (64-bit signed integer) to an equivalent byte (8-bit unsigned integer). |
static byte |
ToByte(java.lang.Object val)
Converts the value of the specified Object to a byte (8-bit unsigned integer). |
static byte |
ToByte(short val)
Converts the value of the specified short (16-bit signed integer) to an equivalent byte (8-bit unsigned integer). |
static byte |
ToByte(java.lang.String val)
Converts the specified String representation of a number to an equivalent byte (8-bit unsigned integer). |
static byte[] |
ToByteArray(java.lang.String source,
java.lang.String encoding)
Encodes the source string into a sequence of bytes using the named encoding, storing the result into a new byte array. |
static char |
ToChar(int val)
Converts an Int value to Char and only works if it is between Character.MAX_VALUE and Character.MIN_VALUE. |
static char[] |
ToCharArray(java.lang.String source)
Returns the String as a char array. |
static double |
ToDouble(boolean val)
Converts the value of the specified boolean value to the equivalent double (double-precision floating point number). |
static double |
ToDouble(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to the equivalent double (double-precision floating point number). |
static double |
ToDouble(char val)
Deprecated. Since this is not supported by Java Language. |
static double |
ToDouble(double val)
Returns the specified double (double-precision floating point number); no actual conversion is performed. |
static double |
ToDouble(float val)
Converts the value of the specified float (single-precision floating point number) to an equivalent double (double-precision floating point number). |
static double |
ToDouble(int val)
Converts the value of the specified int (32-bit signed integer) to an equivalent double (double-precision floating point number). |
static double |
ToDouble(long val)
Converts the value of the specified long (64-bit signed integer) to an equivalent double (double-precision floating point number). |
static double |
ToDouble(java.lang.Object val)
Converts the value of the specified Object to a double (double-precision floating point number). |
static double |
ToDouble(short val)
Converts the value of the specified short (16-bit signed integer) to an equivalent double (double-precision floating point number). |
static double |
ToDouble(java.lang.String val)
Converts the specified String representation of a number to an equivalent double (double-precision floating point number). |
static float |
ToFloat(boolean val)
Converts the value of the specified boolean value to the equivalent float (single-precision floating point number). |
static float |
ToFloat(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to the equivalent float (single-precision floating point number). |
static float |
ToFloat(char val)
Calling this method always throws XPFormatException. |
static float |
ToFloat(double val)
Converts the value of the specified double (double-precision floating point number) to an equivalent float (single-precision floating point number). |
static float |
ToFloat(float val)
Returns the specified float (single-precision floating point number); no actual conversion is performed. |
static float |
ToFloat(int val)
Converts the value of the specified int (32-bit signed integer) to an equivalent float (single-precision floating point number). |
static float |
ToFloat(long val)
Converts the value of the specified long (64-bit signed integer) to an equivalent float (single-precision floating point number). |
static float |
ToFloat(java.lang.Object val)
Converts the value of the specified Object to a float (single-precision floating point number). |
static float |
ToFloat(short val)
Converts the value of the specified short (16-bit signed integer) to an equivalent float (single-precision floating point number). |
static float |
ToFloat(java.lang.String val)
Converts the specified String representation of a number to an equivalent float (single-precision floating point number). |
static java.lang.String |
ToHexString(int i)
Returns a Hexadecimal value on string format for a given integer. |
static java.lang.Object |
ToHexString(long l)
Returns a Hexadecimal value on string format for a given long value. |
static int |
ToInteger(boolean val)
Converts the value of the specified boolean value to the equivalent int (32-bit signed integer). |
static int |
ToInteger(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to the equivalent int (32-bit signed integer). |
static int |
ToInteger(char val)
Deprecated. Since this is not supported by Java Language. |
static int |
ToInteger(double val)
Converts the value of the specified double (double-precision floating point number) to an equivalent int (32-bit signed integer). |
static int |
ToInteger(float val)
Converts the value of the specified float (single-precision floating point number) to an equivalent int (32-bit signed integer). |
static int |
ToInteger(int val)
Returns the specified int (32-bit signed integer); no actual conversion is performed. |
static int |
ToInteger(long val)
Converts the value of the specified long (64-bit signed integer) to an equivalent int (32-bit signed integer). |
static int |
ToInteger(java.lang.Object val)
Converts the value of the specified Object to a 32-bit signed integer. |
static int |
ToInteger(short val)
Converts the value of the specified short (16-bit signed integer) to an equivalent int (32-bit signed integer). |
static int |
ToInteger(java.lang.String val)
Converts the specified String representation of a number to an equivalent int (32-bit signed integer). |
static long |
ToLong(boolean val)
Converts the value of the specified boolean value to the equivalent long (64-bit signed integer). |
static long |
ToLong(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to the equivalent long (64-bit signed integer). |
static long |
ToLong(char val)
Deprecated. Since this is not supported by Java Language. |
static long |
ToLong(double val)
Converts the value of the specified double (double-precision floating point number) to an equivalent long (64-bit signed integer). |
static long |
ToLong(float val)
Converts the value of the specified float (single-precision floating point number) to an equivalent long (64-bit signed integer). |
static long |
ToLong(int val)
Converts the value of the specified int (32-bit signed integer) to an equivalent long (64-bit signed integer). |
static long |
ToLong(long val)
Returns the specified long (64-bit signed integer); no actual conversion is performed. |
static long |
ToLong(java.lang.Object val)
Converts the value of the specified Object to a long (64-bit signed integer). |
static long |
ToLong(short val)
Converts the value of the specified short (16-bit signed integer) to an equivalent long (64-bit signed integer). |
static long |
ToLong(java.lang.String val)
Converts the specified String representation of a number to an equivalent long (64-bit signed integer). |
static short |
ToShort(boolean val)
Converts the value of the specified boolean value to the equivalent short (16-bit signed integer). |
static short |
ToShort(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to the equivalent short (16-bit signed integer). |
static short |
ToShort(char val)
Converts the value of the specified Unicode character to the equivalent short (16-bit signed integer). |
static short |
ToShort(double val)
Converts the value of the specified double (double-precision floating point number) to an equivalent short (16-bit signed integer). |
static short |
ToShort(float val)
Converts the value of the specified float (single-precision floating point number) to an equivalent short (16-bit signed integer). |
static short |
ToShort(int val)
Converts the value of the specified int (32-bit signed integer) to an equivalent short (16-bit signed integer). |
static short |
ToShort(long val)
Converts the value of the specified long (64-bit signed integer) to an equivalent short (16-bit signed integer). |
static short |
ToShort(java.lang.Object val)
Converts the value of the specified Object to a 16-bit signed integer. |
static short |
ToShort(short val)
Returns the specified short (16-bit signed integer); no actual conversion is performed. |
static short |
ToShort(java.lang.String val)
Converts the specified String representation of a number to an equivalent short (16-bit signed integer). |
static java.lang.String |
ToString(boolean val)
Converts the value of the specified boolean to its equivalent String representation. |
static java.lang.String |
ToString(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to its equivalent String representation. |
static java.lang.String |
ToString(char val)
Converts the value of the specified Unicode character to its equivalent String representation. |
static java.lang.String |
ToString(double val)
Converts the value of the specified double (double-precision floating point number) to its equivalent String representation. |
static java.lang.String |
ToString(float val)
Converts the value of the specified float (single-precision floating point number) to its equivalent String representation. |
static java.lang.String |
ToString(int val)
Converts the value of the specified int (32-bit signed integer) to its equivalent String representation. |
static java.lang.String |
ToString(long val)
Converts the value of the specified long (64-bit signed integer) to its equivalent String representation. |
static java.lang.String |
ToString(java.lang.Object val)
Converts the value of the specified Object to its String representation. |
static java.lang.String |
ToString(short val)
Converts the value of the specified short (16-bit signed integer) to its equivalent String representation. |
static java.lang.String |
ToString(java.lang.String val)
Returns the specified instance of String; no actual conversion is performed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XPConvert()
Method Detail |
---|
public static boolean ToBoolean(boolean val)
val
- A boolean
public static boolean ToBoolean(byte val)
val
- A byte (8-bit unsigned integer)
true
if value is not zero; otherwise, false
.public static boolean ToBoolean(char val)
val
- A Unicode character
public static boolean ToBoolean(double val)
val
- A double (double-precision floating point number)
true
if value is not zero; otherwise, false
.public static boolean ToBoolean(short val)
val
- A short (16-bit signed integer)
true
if value is not zero; otherwise, false
.public static boolean ToBoolean(int val)
val
- An int (32-bit signed integer)
true
if value is not zero; otherwise, false
.public static boolean ToBoolean(long val)
val
- A long (64-bit signed integer)
true
if value is not zero; otherwise, false
.public static boolean ToBoolean(java.lang.Object val)
val
- An Object or a null reference
true
or false
; the result of invoking ToBoolean
on underlying type.public static boolean ToBoolean(float val)
val
- A float (single-precision floating point number).
true
if value is not zero; otherwise, false
.public static boolean ToBoolean(java.lang.String val)
val
- A string that contains the value of "true", "True", "false", "False", "1", or "0"
true
if string equals "true", "True", or "1", false
if string equals "false", "False", or "0"public static byte ToByte(boolean val)
val
- A boolean value
1
if value is true; otherwise, 0
public static byte ToByte(byte val)
val
- A byte (8-bit unsigned integer)
public static byte ToByte(char val)
val
- A Unicode character
public static byte ToByte(double val)
val
- A double (double-precision floating point number)
double
as a byte
(by
casting to a byte
).public static byte ToByte(short val)
val
- A short (16-bit signed integer)
short
as a byte
(by
casting to a byte
).public static byte ToByte(int val)
val
- An int (32-bit signed integer)
int
as a byte
(by
casting to a byte
).public static byte ToByte(long val)
val
- A long (64-bit signed integer)
long
as a byte
(by
casting to a byte
).public static byte ToByte(java.lang.Object val)
val
- An Object or a null reference
ToByte
on underlying type.public static byte ToByte(float val)
val
- A float (single-precision floating point number)
float
as a byte
(by
casting to a byte
).public static byte ToByte(java.lang.String val)
val
- A String containing a number to convert.
public static char ToChar(int val)
val
- integer to be converted.
XPFormatException
- if entered int is out of bounds.public static double ToDouble(boolean val)
val
- A boolean
1
if value is true; otherwise, 0
public static double ToDouble(byte val)
val
- A byte (8-bit unsigned integer)
byte
as a double
.public static double ToDouble(char val)
val
- A Unicode character
public static double ToDouble(double val)
val
- A double (double-precision floating point number)
public static double ToDouble(short val)
val
- A short (16-bit signed integer)
short
as a double
.public static double ToDouble(int val)
val
- An int (32-bit signed integer)
int
as a double
.public static double ToDouble(long val)
val
- A long (64-bit signed integer)
long
as a double
.public static double ToDouble(java.lang.Object val)
val
- An Object or a null reference
ToDouble
on underlying type.public static double ToDouble(float val)
val
- A float (single-precision floating point number)
float
as a double
.public static double ToDouble(java.lang.String val)
val
- A String
public static short ToShort(boolean val)
val
- A boolean
1
if value is true; otherwise, 0
public static short ToShort(byte val)
val
- A byte (8-bit unsigned integer)
byte
as a short
.public static short ToShort(char val)
val
- A Unicode character
char
as a short
(by
casting to a short
).public static short ToShort(double val)
val
- A double (double-precision floating point number)
double
as a short
(by
casting to a short
).public static short ToShort(short val)
val
- A short (16-bit signed integer)
public static short ToShort(int val)
val
- An int (32-bit signed integer)
int
as a short
(by
casting to a short
).public static short ToShort(long val)
val
- A long (64-bit signed integer)
long
as a short
(by
casting to a short
).public static short ToShort(java.lang.Object val)
val
- An Object or a null reference
ToShort
on underlying type.public static short ToShort(float val)
val
- A float (single-precision floating point number)
float
as a short
(by
casting to a short
).public static short ToShort(java.lang.String val)
val
- A String
public static int ToInteger(boolean val)
val
- A boolean
1
if value is true; otherwise, 0
public static int ToInteger(byte val)
val
- A byte (8-bit unsigned integer)
byte
as an int
.public static int ToInteger(char val)
val
- A Unicode character
char
as an int
.public static int ToInteger(double val)
val
- A double (double-precision floating point number)
double
as an int
(by
casting to an int
).public static int ToInteger(short val)
val
- A short (16-bit signed integer)
short
as an int
.public static int ToInteger(int val)
val
- An int (32-bit signed integer)
public static int ToInteger(long val)
val
- A long (64-bit signed integer)
long
as an int
(by
casting to an int
).public static int ToInteger(java.lang.Object val)
val
- An Object or a null reference
ToInteger
on underlying type.public static int ToInteger(float val)
val
- A float (single-precision floating point number)
float
as an int
(by
casting to an int
).public static int ToInteger(java.lang.String val)
val
- A String
public static long ToLong(boolean val)
val
- A boolean
1
if value is true; otherwise, 0
public static long ToLong(byte val)
val
- A byte (8-bit unsigned integer)
byte
as a long
.public static long ToLong(char val)
val
- A Unicode character
char
as a long
.public static long ToLong(double val)
val
- A double (double-precision floating point number)
double
as a long
(by
casting to a long
).public static long ToLong(short val)
val
- A short (16-bit signed integer)
short
as a long
.public static long ToLong(int val)
val
- An int (32-bit signed integer)
int
as a long
.public static long ToLong(long val)
val
- A long (64-bit signed integer)
public static long ToLong(java.lang.Object val)
val
- An Object or a null reference
ToLong
on underlying type.public static long ToLong(float val)
val
- A float (single-precision floating point number)
float
as a long
(by
casting to a long
).public static long ToLong(java.lang.String val)
val
- A String
public static float ToFloat(boolean val)
val
- A boolean
1
if value is true; otherwise, 0
public static float ToFloat(byte val)
val
- A byte (8-bit unsigned integer)
byte
as a float
.public static float ToFloat(char val)
val
- A Unicode character
public static float ToFloat(double val)
val
- A double (double-precision floating point number)
double
as a float
(by
casting to a float
).public static float ToFloat(short val)
val
- A short (16-bit signed integer)
short
as a float
.public static float ToFloat(int val)
val
- An int (32-bit signed integer)
int
as a float
.public static float ToFloat(long val)
val
- A long (64-bit signed integer)
long
as a float
.public static float ToFloat(java.lang.Object val)
val
- An Object or a null reference
ToFloat
on underlying type.public static float ToFloat(float val)
val
- A float (single-precision floating point number)
public static float ToFloat(java.lang.String val)
val
- A String
public static java.lang.String ToString(boolean val)
val
- A boolean
"true"
if value is true; otherwise, "false"
public static java.lang.String ToString(byte val)
val
- A byte (8-bit unsigned integer)
public static java.lang.String ToString(char val)
val
- A Unicode character
public static java.lang.String ToString(double val)
val
- A double (double-precision floating point number)
public static java.lang.String ToString(short val)
val
- A short (16-bit signed integer)
public static java.lang.String ToString(int val)
val
- An int (32-bit signed integer)
public static java.lang.String ToString(long val)
val
- A long (64-bit signed integer)
public static java.lang.String ToString(java.lang.Object val)
val
- An Object or a null reference
ToString
on underlying type.public static java.lang.String ToString(float val)
val
- A float (single-precision floating point number)
public static java.lang.String ToString(java.lang.String val)
val
- A String
public static byte[] ToByteArray(java.lang.String source, java.lang.String encoding)
source
- The String to encode.encoding
- Encoding string. Currently only "UTF-8" is supported.
public static char[] ToCharArray(java.lang.String source)
source
- A String
public static java.lang.String ToHexString(int i)
i
- integer to be converted.
public static java.lang.Object ToHexString(long l)
l
- long value to be converted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |