Methods | This Package | All Packages
Provides methods for data type conversions, string formatting, and string parsing.
package com.ms.wfc.util
public class Value
Remarks
This class supports conversions between primitive types (such as int, double, and boolean), primitive wrapper objects (such as Integer, Double, and Boolean), Strings, variants (objects of type com.ms.com.Variant), and Time objects. The conversion methods fall into the following four categories:
public xxx toxxx( Object value )
Converts an object to a primitive type value. The argument can be a primitive wrapper object, a string, or a variant, and the result is the value of the argument converted to a primitive type.
public Object toObject( xxx value )
Converts a primitive type value or a variant value to a primitive wrapper object. If the argument is a primitive type value, the result is a primitive wrapper object of the corresponding type. If the argument is a variant, the result is a primitive wrapper object that corresponds to the dynamic type of the variant.
public String toString( xxx value )
Converts a primitive type value or an object to a string. If the argument is a primitive type value, the result is the string representation of the value. If the argument is an object, the result is the string produced by calling the object's toString method.
public Variant toVariant( xxx value )
Converts a primitive type value, a primitive wrapper object, or a string to a variant.
The following table lists the associations used by the toObject method to convert a variant to a Java wrapper object.
Variant | Java Class |
VariantEmpty | null |
VariantNull | null |
VariantShort | java.lang.Short |
VariantInt | java.lang.Integer |
VariantFloat | java.lang.Float |
VariantDouble | java.lang.Double |
VariantCurrency | java.lang.Double |
VariantDate | com.ms.wfc.app.Time |
VariantString | java.lang.String |
VariantDispatch | java.lang.Object |
VariantError | java.lang.Integer |
VariantBoolean | java.lang.Boolean |
VariantUnknown | java.lang.Object |
VariantDecimal | java.lang.Double |
VariantSignedChar | java.lang.Byte |
VariantByte | java.lang.Byte |
The following table lists the associations used by the toVariant method to convert a Java wrapper object to a variant.
Java Class | Variant |
java.lang.Object | VariantDispatch |
java.lang.Boolean | VariantBoolean |
java.lang.Character | VariantShort |
java.lang.Byte | VariantByte |
java.lang.Short | VariantShort |
java.lang.Integer | VariantInt |
java.lang.Long | VariantDouble |
java.lang.Float | VariantFloat |
java.lang.Double | VariantDouble |
java.lang.String | VariantString |
com.ms.wfc.app.Time | VariantDate |