com.plumtree.openfoundation.util
Class XPConvert

java.lang.Object
  extended by com.plumtree.openfoundation.util.XPConvert

public class XPConvert
extends java.lang.Object

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

XPConvert

public XPConvert()
Method Detail

ToBoolean

public static boolean ToBoolean(boolean val)
Returns the specified boolean value; no actual conversion is performed.

Parameters:
val - A boolean
Returns:
Parameter val is returned unchanged.

ToBoolean

public static boolean ToBoolean(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to an equivalent boolean value.

Parameters:
val - A byte (8-bit unsigned integer)
Returns:
true if value is not zero; otherwise, false.

ToBoolean

public static boolean ToBoolean(char val)
Calling this method always throws XPFormatException.

Parameters:
val - A Unicode character
Returns:
This conversion is not supported. No value is returned.

ToBoolean

public static boolean ToBoolean(double val)
Converts the value of the specified double (double-precision floating point number) to an equivalent boolean value.

Parameters:
val - A double (double-precision floating point number)
Returns:
true if value is not zero; otherwise, false.

ToBoolean

public static boolean ToBoolean(short val)
Converts the value of the specified short (16-bit signed integer) to an equivalent boolean value.

Parameters:
val - A short (16-bit signed integer)
Returns:
true if value is not zero; otherwise, false.

ToBoolean

public static boolean ToBoolean(int val)
Converts the value of the specified int (32-bit signed integer) to an equivalent boolean value.

Parameters:
val - An int (32-bit signed integer)
Returns:
true if value is not zero; otherwise, false.

ToBoolean

public static boolean ToBoolean(long val)
Converts the value of the specified long (64-bit signed integer) to an equivalent Boolean value.

Parameters:
val - A long (64-bit signed integer)
Returns:
true if value is not zero; otherwise, false.

ToBoolean

public static boolean ToBoolean(java.lang.Object val)
Converts the value of a specified Object to an equivalent boolean value.

Parameters:
val - An Object or a null reference
Returns:
true or false; the result of invoking ToBoolean on underlying type.

ToBoolean

public static boolean ToBoolean(float val)
Converts the value of the specified float (single-precision floating point number) to an equivalent boolean value.

Parameters:
val - A float (single-precision floating point number).
Returns:
true if value is not zero; otherwise, false.

ToBoolean

public static boolean ToBoolean(java.lang.String val)
Converts the specified String representation of a logical value to its boolean equivalent.

Parameters:
val - A string that contains the value of "true", "True", "false", "False", "1", or "0"
Returns:
true if string equals "true", "True", or "1", false if string equals "false", "False", or "0"

ToByte

public static byte ToByte(boolean val)
Converts the value of the specified boolean value to the equivalent byte (8-bit unsigned integer).

Parameters:
val - A boolean value
Returns:
The number 1 if value is true; otherwise, 0

ToByte

public static byte ToByte(byte val)
Returns the specified byte (8-bit unsigned integer); no actual conversion is performed.

Parameters:
val - A byte (8-bit unsigned integer)
Returns:
Parameter val is returned unchanged.

ToByte

public static byte ToByte(char val)
Converts the value of the specified Unicode character to the equivalent byte (8-bit unsigned integer).

Parameters:
val - A Unicode character
Returns:
The byte (8-bit unsigned integer) equivalent to val

ToByte

public 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).

Parameters:
val - A double (double-precision floating point number)
Returns:
The value of the double as a byte (by casting to a byte).

ToByte

public static byte ToByte(short val)
Converts the value of the specified short (16-bit signed integer) to an equivalent byte (8-bit unsigned integer).

Parameters:
val - A short (16-bit signed integer)
Returns:
The value of the short as a byte (by casting to a byte).

ToByte

public static byte ToByte(int val)
Converts the value of the specified int (32-bit signed integer) to an equivalent byte (8-bit unsigned integer).

Parameters:
val - An int (32-bit signed integer)
Returns:
The value of the int as a byte (by casting to a byte).

ToByte

public static byte ToByte(long val)
Converts the value of the specified long (64-bit signed integer) to an equivalent byte (8-bit unsigned integer).

Parameters:
val - A long (64-bit signed integer)
Returns:
The value of the long as a byte (by casting to a byte).

ToByte

public static byte ToByte(java.lang.Object val)
Converts the value of the specified Object to a byte (8-bit unsigned integer).

Parameters:
val - An Object or a null reference
Returns:
The result of invoking ToByte on underlying type.

ToByte

public 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).

Parameters:
val - A float (single-precision floating point number)
Returns:
The value of the float as a byte (by casting to a byte).

ToByte

public static byte ToByte(java.lang.String val)
Converts the specified String representation of a number to an equivalent byte (8-bit unsigned integer).

Parameters:
val - A String containing a number to convert.
Returns:
A byte (8-bit unsigned integer) equivalent to the value of val

ToChar

public 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.

Parameters:
val - integer to be converted.
Returns:
char value converted.
Throws:
XPFormatException - if entered int is out of bounds.

ToDouble

public static double ToDouble(boolean val)
Converts the value of the specified boolean value to the equivalent double (double-precision floating point number).

Parameters:
val - A boolean
Returns:
The number 1 if value is true; otherwise, 0

ToDouble

public 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).

Parameters:
val - A byte (8-bit unsigned integer)
Returns:
The value of the byte as a double.

ToDouble

public static double ToDouble(char val)
Deprecated. Since this is not supported by Java Language.

Calling this method always throws XPFormatException.

Parameters:
val - A Unicode character
Returns:
This conversion is not supported. No value is returned.

ToDouble

public static double ToDouble(double val)
Returns the specified double (double-precision floating point number); no actual conversion is performed.

Parameters:
val - A double (double-precision floating point number)
Returns:
Parameter val is returned unchanged.

ToDouble

public 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).

Parameters:
val - A short (16-bit signed integer)
Returns:
The value of the short as a double.

ToDouble

public 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).

Parameters:
val - An int (32-bit signed integer)
Returns:
The value of the int as a double.

ToDouble

public 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).

Parameters:
val - A long (64-bit signed integer)
Returns:
The value of the long as a double.

ToDouble

public static double ToDouble(java.lang.Object val)
Converts the value of the specified Object to a double (double-precision floating point number).

Parameters:
val - An Object or a null reference
Returns:
The result of invoking ToDouble on underlying type.

ToDouble

public 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).

Parameters:
val - A float (single-precision floating point number)
Returns:
The value of the float as a double.

ToDouble

public static double ToDouble(java.lang.String val)
Converts the specified String representation of a number to an equivalent double (double-precision floating point number). Does not localize, and always uses the default locale representation ("." for decimal point, et cetera).

Parameters:
val - A String
Returns:
A double (double-precision floating point number) equivalent to the value of val

ToShort

public static short ToShort(boolean val)
Converts the value of the specified boolean value to the equivalent short (16-bit signed integer).

Parameters:
val - A boolean
Returns:
The number 1 if value is true; otherwise, 0

ToShort

public static short ToShort(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to the equivalent short (16-bit signed integer).

Parameters:
val - A byte (8-bit unsigned integer)
Returns:
The value of the byte as a short.

ToShort

public static short ToShort(char val)
Converts the value of the specified Unicode character to the equivalent short (16-bit signed integer).

Parameters:
val - A Unicode character
Returns:
The value of the char as a short (by casting to a short).

ToShort

public 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).

Parameters:
val - A double (double-precision floating point number)
Returns:
The value of the double as a short (by casting to a short).

ToShort

public static short ToShort(short val)
Returns the specified short (16-bit signed integer); no actual conversion is performed.

Parameters:
val - A short (16-bit signed integer)
Returns:
Parameter val is returned unchanged.

ToShort

public static short ToShort(int val)
Converts the value of the specified int (32-bit signed integer) to an equivalent short (16-bit signed integer).

Parameters:
val - An int (32-bit signed integer)
Returns:
The value of the int as a short (by casting to a short).

ToShort

public static short ToShort(long val)
Converts the value of the specified long (64-bit signed integer) to an equivalent short (16-bit signed integer).

Parameters:
val - A long (64-bit signed integer)
Returns:
The value of the long as a short (by casting to a short).

ToShort

public static short ToShort(java.lang.Object val)
Converts the value of the specified Object to a 16-bit signed integer.

Parameters:
val - An Object or a null reference
Returns:
The result of invoking ToShort on underlying type.

ToShort

public 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).

Parameters:
val - A float (single-precision floating point number)
Returns:
The value of the float as a short (by casting to a short).

ToShort

public static short ToShort(java.lang.String val)
Converts the specified String representation of a number to an equivalent short (16-bit signed integer).

Parameters:
val - A String
Returns:
A short (16-bit signed integer) equivalent to the value of val

ToInteger

public static int ToInteger(boolean val)
Converts the value of the specified boolean value to the equivalent int (32-bit signed integer).

Parameters:
val - A boolean
Returns:
The number 1 if value is true; otherwise, 0

ToInteger

public static int ToInteger(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to the equivalent int (32-bit signed integer).

Parameters:
val - A byte (8-bit unsigned integer)
Returns:
The value of the byte as an int.

ToInteger

public static int ToInteger(char val)
Deprecated. Since this is not supported by Java Language.

Converts the value of the specified Unicode character (16-bit unsigned representation) to the equivalent int (32-bit signed integer) by widening.

Parameters:
val - A Unicode character
Returns:
The value of the char as an int.

ToInteger

public 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).

Parameters:
val - A double (double-precision floating point number)
Returns:
The value of the double as an int (by casting to an int).

ToInteger

public static int ToInteger(short val)
Converts the value of the specified short (16-bit signed integer) to an equivalent int (32-bit signed integer).

Parameters:
val - A short (16-bit signed integer)
Returns:
The value of the short as an int.

ToInteger

public static int ToInteger(int val)
Returns the specified int (32-bit signed integer); no actual conversion is performed.

Parameters:
val - An int (32-bit signed integer)
Returns:
Parameter val is returned unchanged.

ToInteger

public static int ToInteger(long val)
Converts the value of the specified long (64-bit signed integer) to an equivalent int (32-bit signed integer).

Parameters:
val - A long (64-bit signed integer)
Returns:
The value of the long as an int (by casting to an int).

ToInteger

public static int ToInteger(java.lang.Object val)
Converts the value of the specified Object to a 32-bit signed integer.

Parameters:
val - An Object or a null reference
Returns:
The result of invoking ToInteger on underlying type.

ToInteger

public 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).

Parameters:
val - A float (single-precision floating point number)
Returns:
The value of the float as an int (by casting to an int).

ToInteger

public static int ToInteger(java.lang.String val)
Converts the specified String representation of a number to an equivalent int (32-bit signed integer).

Parameters:
val - A String
Returns:
An int (32-bit signed integer) equivalent to the value of val

ToLong

public static long ToLong(boolean val)
Converts the value of the specified boolean value to the equivalent long (64-bit signed integer).

Parameters:
val - A boolean
Returns:
The number 1 if value is true; otherwise, 0

ToLong

public static long ToLong(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to the equivalent long (64-bit signed integer).

Parameters:
val - A byte (8-bit unsigned integer)
Returns:
The value of the byte as a long.

ToLong

public static long ToLong(char val)
Deprecated. Since this is not supported by Java Language.

Converts the value of the specified Unicode character to the equivalent long (64-bit signed integer).

Parameters:
val - A Unicode character
Returns:
The value of the char as a long.

ToLong

public 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).

Parameters:
val - A double (double-precision floating point number)
Returns:
The value of the double as a long (by casting to a long).

ToLong

public static long ToLong(short val)
Converts the value of the specified short (16-bit signed integer) to an equivalent long (64-bit signed integer).

Parameters:
val - A short (16-bit signed integer)
Returns:
The value of the short as a long.

ToLong

public static long ToLong(int val)
Converts the value of the specified int (32-bit signed integer) to an equivalent long (64-bit signed integer).

Parameters:
val - An int (32-bit signed integer)
Returns:
The value of the int as a long.

ToLong

public static long ToLong(long val)
Returns the specified long (64-bit signed integer); no actual conversion is performed.

Parameters:
val - A long (64-bit signed integer)
Returns:
Parameter val is returned unchanged.

ToLong

public static long ToLong(java.lang.Object val)
Converts the value of the specified Object to a long (64-bit signed integer).

Parameters:
val - An Object or a null reference
Returns:
The result of invoking ToLong on underlying type.

ToLong

public 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).

Parameters:
val - A float (single-precision floating point number)
Returns:
The value of the float as a long (by casting to a long).

ToLong

public static long ToLong(java.lang.String val)
Converts the specified String representation of a number to an equivalent long (64-bit signed integer).

Parameters:
val - A String
Returns:
A long (64-bit signed integer) equivalent to the value of val

ToFloat

public static float ToFloat(boolean val)
Converts the value of the specified boolean value to the equivalent float (single-precision floating point number).

Parameters:
val - A boolean
Returns:
The number 1 if value is true; otherwise, 0

ToFloat

public 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).

Parameters:
val - A byte (8-bit unsigned integer)
Returns:
The value of the byte as a float.

ToFloat

public static float ToFloat(char val)
Calling this method always throws XPFormatException.

Parameters:
val - A Unicode character
Returns:
This conversion is not supported. No value is returned.

ToFloat

public 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).

Parameters:
val - A double (double-precision floating point number)
Returns:
The value of the double as a float (by casting to a float).

ToFloat

public 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).

Parameters:
val - A short (16-bit signed integer)
Returns:
The value of the short as a float.

ToFloat

public 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).

Parameters:
val - An int (32-bit signed integer)
Returns:
The value of the int as a float.

ToFloat

public 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).

Parameters:
val - A long (64-bit signed integer)
Returns:
The value of the long as a float.

ToFloat

public static float ToFloat(java.lang.Object val)
Converts the value of the specified Object to a float (single-precision floating point number).

Parameters:
val - An Object or a null reference
Returns:
The result of invoking ToFloat on underlying type.

ToFloat

public static float ToFloat(float val)
Returns the specified float (single-precision floating point number); no actual conversion is performed.

Parameters:
val - A float (single-precision floating point number)
Returns:
Parameter val is returned unchanged.

ToFloat

public static float ToFloat(java.lang.String val)
Converts the specified String representation of a number to an equivalent float (single-precision floating point number).

Parameters:
val - A String
Returns:
A float (single-precision floating point number) equivalent to the value of val

ToString

public static java.lang.String ToString(boolean val)
Converts the value of the specified boolean to its equivalent String representation.

Parameters:
val - A boolean
Returns:
The string "true" if value is true; otherwise, "false"

ToString

public static java.lang.String ToString(byte val)
Converts the value of the specified byte (8-bit unsigned integer) to its equivalent String representation.

Parameters:
val - A byte (8-bit unsigned integer)
Returns:
The String equivalent of the value of val.

ToString

public static java.lang.String ToString(char val)
Converts the value of the specified Unicode character to its equivalent String representation.

Parameters:
val - A Unicode character
Returns:
The String equivalent of the value of val.

ToString

public static java.lang.String ToString(double val)
Converts the value of the specified double (double-precision floating point number) to its equivalent String representation.

Parameters:
val - A double (double-precision floating point number)
Returns:
The String equivalent of the value of val.

ToString

public static java.lang.String ToString(short val)
Converts the value of the specified short (16-bit signed integer) to its equivalent String representation.

Parameters:
val - A short (16-bit signed integer)
Returns:
The String equivalent of the value of val.

ToString

public static java.lang.String ToString(int val)
Converts the value of the specified int (32-bit signed integer) to its equivalent String representation.

Parameters:
val - An int (32-bit signed integer)
Returns:
The String equivalent of the value of val.

ToString

public static java.lang.String ToString(long val)
Converts the value of the specified long (64-bit signed integer) to its equivalent String representation.

Parameters:
val - A long (64-bit signed integer)
Returns:
The String equivalent of the value of val.

ToString

public static java.lang.String ToString(java.lang.Object val)
Converts the value of the specified Object to its String representation.

Parameters:
val - An Object or a null reference
Returns:
The result of invoking ToString on underlying type.

ToString

public static java.lang.String ToString(float val)
Converts the value of the specified float (single-precision floating point number) to its equivalent String representation.

Parameters:
val - A float (single-precision floating point number)
Returns:
The String equivalent of the value of val.

ToString

public static java.lang.String ToString(java.lang.String val)
Returns the specified instance of String; no actual conversion is performed.

Parameters:
val - A String
Returns:
Parameter val is returned unchanged.

ToByteArray

public 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. Currently only "UTF-8" encoding is supported.

Parameters:
source - The String to encode.
encoding - Encoding string. Currently only "UTF-8" is supported.
Returns:
A byte array containing the encoded representation of the specified string.

ToCharArray

public static char[] ToCharArray(java.lang.String source)
Returns the String as a char array.

Parameters:
source - A String
Returns:
A char array containing the characters in the source string

ToHexString

public static java.lang.String ToHexString(int i)
Returns a Hexadecimal value on string format for a given integer.

Parameters:
i - integer to be converted.
Returns:
an unsigned hex String representation.

ToHexString

public static java.lang.Object ToHexString(long l)
Returns a Hexadecimal value on string format for a given long value.

Parameters:
l - long value to be converted.
Returns:
an unsigned hex String representation


Copyright © 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.