au.com.swz.jatlom
Class Variant

java.lang.Object
  extended by au.com.swz.jatlom.Variant

public class Variant
extends java.lang.Object

Describes a data item whose content can vary by type. A variant is used as variable, parameter or function return type.

Author:
Mark Richter

Constructor Summary
Variant()
           
 
Method Summary
 boolean booleanValue()
          The value of this variant as a boolean.
 byte byteValue()
          The value of this variant as a byte.
 java.lang.String convertToString()
           
 double doubleValue()
          The value of this variant as a double.
 boolean equals(java.lang.Object obj)
          Checks this type variant with equality to the specified object.
 boolean equals(Variant variant)
          Checks this variant with equality to the specified variant.
 float floatValue()
          The value of this variant as a float.
 VarType getType()
          The type enclosed within this variant.
 int intValue()
          The value of this variant as an int.
 long longValue()
          The value of this variant as a long.
 short shortValue()
          The value of this variant as a short.
 java.lang.String stringValue()
          The value of this variant as a String.
 Variant variantValue()
          The value of this variant as a Variant.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Variant

public Variant()
Method Detail

getType

public VarType getType()
The type enclosed within this variant.

Returns:
the type enclosed within this variant.

byteValue

public byte byteValue()
The value of this variant as a byte. Valid id getType() == VT_I1.

Returns:
the value of this variant as a byte.

shortValue

public short shortValue()
The value of this variant as a short. Valid id getType() == VT_I2.

Returns:
the value of this variant as a short.

intValue

public int intValue()
The value of this variant as an int. Valid id getType() == VT_I4, VT_UI2, VT_INT.

Returns:
the value of this variant as an int.

longValue

public long longValue()
The value of this variant as a long. Valid id getType() == VT_UI4 or VT_UINT, VT_I8.

Returns:
the value of this variant as a long.

booleanValue

public boolean booleanValue()
The value of this variant as a boolean. Valid id getType() == VT_BOOL.

Returns:
the value of this variant as a boolean.

floatValue

public float floatValue()
The value of this variant as a float. Valid id getType() == VT_R4.

Returns:
the value of this variant as a float.

doubleValue

public double doubleValue()
The value of this variant as a double. Valid id getType() == VT_R8.

Returns:
the value of this variant as a double.

stringValue

public java.lang.String stringValue()
The value of this variant as a String. Valid id getType() == VT_BSTR.

Returns:
the value of this variant as a String.

variantValue

public Variant variantValue()
The value of this variant as a Variant. Valid id getType() == VT_VARIANT.

Returns:
the value of this variant as a Variant.

convertToString

public java.lang.String convertToString()

equals

public boolean equals(java.lang.Object obj)
Checks this type variant with equality to the specified object. If the object is not of type Variant then this method returns false.

Overrides:
equals in class java.lang.Object
Returns:
true if this object equals the specified object.

equals

public boolean equals(Variant variant)
Checks this variant with equality to the specified variant. If all fields in the specified variant are identical to this one then this method returns true otherwise it returns false.

Returns:
true if all fields in the specified variant are identical to this one.