Microsoft SDK for Java

Variant Class Methods

The Variant Class contains the following methods:

changeType invokes the Win32 VariantChangeType function.
clone invokes the Win32 VariantCopy function.
cloneIndirect invokes the Win32 VariantCopyInd function.
finalize performs cleanup before garbage collection.
getBoolean retrieves the value of a VT_BOOL Variant.
getBooleanRef retrieves the referenced value of a VT_BYREF|VT_BOOL Variant.
getByte retrieves the value of a VT_UI1 Variant.
getByteRef retrieves the referenced value of a VT_BYREF|VT_UI1 Variant.
getCurrency retrieves the value of a VT_CY Variant
getCurrencyRef retrieves the referenced value of a VT_BYREF|VT_CY Variant.
getDate retrieves the value of a VT_DATE Variant.
getDateRef retrieves the referenced value of a VT_BYREF|VT_DATE Variant.
getDispatch retrieves the value of a VT_DISPATCH Variant.
getDispatchRef retrieves the referenced value of a VT_BYREF|VT_DISPATCH Variant.
getDouble retrieves the value of a VT_R8 Variant
getDoubleRef retrieves the referenced value of a VT_BYREF|VT_R8 Variant object.
getEmpty verifies that the variant type is VT_EMPTY.
getError retrieves the value of a VT_ERROR Variant.
getErrorRef retrieves the referenced value of a VT_BYREF|VT_ERROR Variant.
getFloat retrieves the value of a VT_R4 Variant.
getFloatRef retrieves the referenced value of a VT_BYREF|VT_R4 Variant object.
getInt retrieves the value of a VT_I4 Variant.
getIntRef retrieves the referenced value of a VT_BYREF|VT_I4 Variant object.
getNull verifies that the variant type is VT_NULL.
getObject retrieves the value of a VT_UNKNOWN Variant
getObjectRef retrieves the referenced value of a VT_BYREF|VT_UNKNOWN Variant.
getShort retrieves the value of a VT_I2 Variant.
getShortRef retrieves the referenced value of a VT_BYREF|VT_I2 Variant object.
getString retrieves the value of a VT_BSTR Variant.
getStringRef retrieves the referenced value of a VT_BYREF|VT_BSTR Variant.
getVariantArray retrieves the value of a VT_ARRAY|VT_VARIANT Variant.
getVariantArrayRef retrieves the referenced value of a VT_BYREF|VT_ARRAY|VT_VARIANT Variant.
getvt extracts the variant type of the Variant object.
noParam sets a Variant object to represent a missing optional parameter.
putBoolean sets the Variant object to type VT_BOOL and clears the previous contents.
putBooleanRef replaces a value referenced by a VT_BYREF|VT_BOOL Variant object.
putByte sets the Variant object to be type VT_UI1 and clears the previous contents.
putByteArray sets a Variant object to type VT_ARRAY|VT_UI1 and clears the previous contents.
putByteRef replaces a value referenced by a VT_BYREF|VT_UI1 Variant object.
putCharArray sets Variant to type VT_ARRAY|VT_I2 and clears the previous contents.
putCurrency sets the Variant object to type VT_CY and clears the previous contents.
putCurrencyRef eplaces a value referenced by a VT_BYREF|VT_CY Variant object.
putDate sets the Variant object to type VT_DATE and clears the previous contents.
putDateRef replaces a value referenced by a VT_BYREF|VT_DATE Variant object.
putDispatch sets the Variant object to type VT_DISPATCH and clears the previous contents.
putDispatchRef replaces a value referenced by a VT_BYREF|VT_DISPATCH Variant object.
putDouble sets the Variant object to type VT_R8 and clears the previous contents.
putDoubleRef replaces a value referenced by a VT_BYREF|VT_R8 Variant object.
putEmpty sets the Variant object to type VT_EMPTY and clears the previous contents.
putError sets the Variant object to type VT_ERROR and clears the previous contents.
putErrorRef replaces a value referenced by a VT_BYREF|VT_ERROR Variant.
putFloat sets the Variant object to type VT_R4 and clears the previous contents.
putFloatRef replaces a value referenced by a VT_BYREF|VT_R4 Variant object.
putInt sets the Variant object to type VT_I4 and clears the previous contents.
putIntRef replaces a value referenced by a VT_BYREF|VT_I4 Variant object.
putNull sets the Variant object to type VT_NULL and clears the previous contents.
putObject sets the Variant object to be type VT_UNKNOWN and clears the previous contents.
putObjectRef replaces a value referenced by a VT_BYREF|VT_UNKNOWN Variant object.
putSafeArray sets the Variant object to type SAFEARRAY and clears the previous contents.
putSafeArrayRef replaces a SafeArray object referenced by the Variant.
putShort sets the Variant object to type VT_I2 and clears the previous contents.
putShortRef replaces a value referenced by a VT_BYREF|VT_I2 Variant object.
putString sets the Variant object to type VT_BSTR and clears the previous contents.
putStringRef replaces a value referenced by a VT_BYREF|VT_BSTR Variant object.
putVariantArray sets a Variant object to a typeVT_ARRAY|VT_VARIANT Variant object, which holds a zero-based, one-dimensional SafeArray.
putVariantArrayRef replaces a SAFEARRAY data structure, which is referenced by a VT_BYREF|VT_ARRAY|VT_VARIANT Variant.
toBoolean coerces the Variant object to a VT_BOOL and returns the coerced result.
toByte coerces the Variant object to a VT_UI1 and returns the coerced result.
toByteArray retrieves the value of a VT_ARRAY|VT_UI1 or VT_BYREF|VT_ARRAY|VT_UI1 as a one-dimensional byte[] array.
toCharArray retrieves the value of a VT_ARRAY|VT_I2 or VT_BYREF|VT_ARRAY|VT_I2 as a one-dimensional char[] array.
toCurrency coerces the Variant object to a VT_CY and returns the coerced result.
to Date coerces the Variant object to a VT_DATE and returns the coerced result.
toDispatch coerces the Variant object to a VT_DISPATCH and returns the coerced result.
toDouble coerces the Variant object to a VT_R8 and returns the coerced result.
toError coerces the Variant object to a VT_ERROR and returns the coerced result.
toFloat coerces the Variant object to a VT_R4 and returns the coerced result.
toInt coerces the Variant object to a VT_I4 and returns the coerced result.
toObject coerces the Variant object to a VT_UNKNOWN and returns the coerced result.
toSafeArray extracts a SafeArray object from a Variant object that has the VT_ARRAY modifier set.
toScriptObject coerces the Variant object to a VT_UNKNOWN, VT_BSTR, VT_BOOL, or VT_R8 and returns the coerced result.
toShort coerces the Variant object to a VT_I2 and returns the coerced result.
toString coerces the Variant object to a VT_BSTR and returns the coerced result.
toVariantArray retrieves the value of either a VT_ARRAY|VT_VARIANT or VT_BYREF|VT_ARRAY|VT_VARIANT Variant.
VariantClear forces the Microsoft® Win32® VariantClear function to be called and resets the Variant object to VT_EMPTY.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.