borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.util
java.lang.Object +----borland.jbcl.util.Variant +----borland.jbcl.dataset.RowVariant +----borland.jbcl.dataset.ColumnVariant
Variables Constructors Properties Methods
Implements Cloneable
The Variant class is a type storage class whose value can be one of many data types. It can hold data of these types:
In JBCL, the dataset package uses the Variant data type frequently because it can handle all types of data.
public static final int ASSIGNED_NULL = 1An integer constant used to identify a data type for values that are explicitly set to null. This is in contrast to data that is never assigned. See UNASSIGNED_NULL.
public static final String AssignedNull_S = "ASSIGNED_NULL"A constant that displays an assigned null value as the string "ASSIGNED_NULL". An assigned null is a value explicitly set to null in contrast to one that is simply not assigned.
public static final int BIGDECIMAL = 10An integer constant used to identify the BigDecimal data type. BigDecimal values have an unlimited precision integer value and an integer scale factor.
public static final int BINARY_STREAM = 12An integer constant used to identify data of a binary stream.
public static final int BOOLEAN = 11An integer constant used to identify data of type boolean.
public static final int BYTE = 2An integer constant used to identify data of type byte.
public static final int BYTE_ARRAY = 18An integer constant used to identify data in a byte array.
public static final String BigDecimalType_S = "BIGDECIMAL"A constant that represents the BigDecimal data type as the string "BIGDECIMAL".
public static final String BinaryStreamType_S = "BINARY_STREAM"A constant that represents a binary stream as the string "BINARY_STREAM".
public static final String BooleanType_S = "BOOLEAN"A constant that represents the boolean data type as the string "BOOLEAN".
public static final String ByteArrayType_S = "BYTE_ARRAY"A constant that displays a byte array as the string "BYTE_ARRAY".
public static final String ByteType_S = "BYTE"A constant that represents the byte data type as the string "BYTE".
public static final int DATE = 13An integer constant used to identify the Date data type.
public static final int DOUBLE = 7An integer constant used to identify the double data type.
public static final String DateType_S = "DATE"A constant that represents the Date data type as the string "DATE".
public static final String DoubleType_S = "DOUBLE"A constant that represents the double date type as the string "DOUBLE".
public static final int FLOAT = 6An integer constant used to identify the float data type.
public static final String FloatType_S = "FLOAT"A constant that represents the float data type as the string "FLOAT".
public static final int INT = 4An integer constant used to identify the int data type.
public static final String IntType_S = "INT"A constant that represents the int data type as the string "INT".
public static final int LONG = 5An integer constant used to identify the long data type.
public static final String LongType_S = "LONG"A constant that represents the long data type as the string "LONG".
public static final int MaxTypes = 18The maximum number of data types Variant can handle.
public static final int NULL_TYPES = 1An integer constant used to identify null data. Null data can be either assigned or unassigned. See ASSIGNED_NULL and UNASSIGNED_NULL.
public static final int OBJECT = 17An integer constant used to identify the Object data type.
public static final String ObjectType_S = "OBJECT"A constant that represents the Object data type as the string "OBJECT".
public static final int SHORT = 3An integer constant used to identify the short data type.
public static final int STRING = 16An integer constant used to identify the String data type.
public static final String ShortType_S = "SHORT"A constant that represents the short data type as the string "SHORT".
public static final String StringType_S = "STRING"A constant that represents the String data type as the string "STRING".
public static final int TIME = 14An integer constant used to identify the Time data type.
public static final int TIMESTAMP = 15An integer constant used to identify the TimeStamp data type.
public static final String TimeType_S = "TIME"A constant that represents the Time data type as the string "TIME".
public static final String TimestampType_S = "TIMESTAMP"A constant that represents the TimeStamp data type as the string "TIMESTAMP".
public static final int UNASSIGNED_NULL = 0An integer constant used to identify an unassigned null value. An unassigned null value is a data value that was never assigned. This is in contrast to an assigned null value that is explicitly assigned. See ASSIGNED_NULL.
public static final String UnassignedNull_S = "UNASSIGNED_NULL"A constant that represents an unassigned null as the string "UNASSIGNED_NULL".
public static final String UnknownType_S = "UNKNOWN"A constant that represents an unknown data type as the string "UNKNOWN".
public static final Variant nullVariant = new Variant(UNASSIGNED_NULL)An integer constant used to identify a Variant data type with an unassigned null data value.
public Variant()Constructs a Variant object without specifying the explicit data type.
public Variant(int dataType)Constructs a Variant object that can contain data of the type specified with the dataType parameter. Variants instantiated with this constructor must have the results of all set operations be of the type specified.
Parameters:
public final int getArrayLength() public final void setArrayLength(int length)Retrieves and sets the length of an array.
Parameters:
public final BigDecimal getAsBigDecimal()Obtains a data value as a BigDecimal data type. It can handle data identified as type BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, BIGDECIMAL, UNASSIGNED_NULL, and ASSIGNED_NULL.
public final double getAsDouble() public final void setAsDouble(double val)Retrieves and sets the value of this Variant as a double data type. It can obtain data identified as type BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, BIGDECIMAL, UNASSIGNED_NULL, and ASSIGNED_NULL. It can set data of type FLOAT and DOUBLE.
Parameters:
public final int getAsInt() public final void setAsInt(int val)Retrieves and sets the value of this Variant as a int data type. It can obtain data identified as type BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, BIGDECIMAL, UNASSIGNED_NULL, and ASSIGNED_NULL. It can set data of type BYTE and SHORT.
Parameters:
public final long getAsLong()Retrieves and sets the value of this Variant as a long data type. It can obtain data identified as type BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, BIGDECIMAL, UNASSIGNED_NULL, and ASSIGNED_NULL.
Parameters:
public final boolean isAssignedNull()Determines whether the data value is an assigned null value. If it returns true, the value is an assigned null value; otherwise, it is not.
public final BigDecimal getBigDecimal() public final void setBigDecimal(java.math.BigDecimal val) public final void setBigDecimal(java.lang.String val)Retrieves and sets the value of this Variant to a BigDecimal data value.
Parameters:
public final InputStream getBinaryStream() public final void set(java.io.InputStream val)Reads data from and stores data to a binary stream.
Binary streams are used to store images such as GIF and JPEG images. They must be re-readable as they are read each tiem they are painted. The InputStream.markSupported() method must return true and the InputStream.mark(0) method should be called before the BinaryStream is added to the DataSet
The GridControl and ImageControl components assume that DataSet columns of type Variant.BinaryStream are displayable images. Set the column's visible property to false to prevent their display.
If your custom BinaryStream requires a custom editor or painter, set these Column level properties to your custom edit and painter classes.
Parameters:
public final boolean getBoolean() public final void setBoolean(boolean val)Retrieves and sets the value of this Variant to a boolean data value.
Parameters:
public final byte getByte() public final void setByte(int val)Retrieves and sets the value of this Variant to a byte data value.
Parameters:
public final byte[] getByteArray()Retrieves the value of this Variant as a byte array.
public final java.sql.Date getDate() public final void setDate(java.sql.Date val) public final void setDate(long val)Retrieves and sets the value of this Variant to a Date data value.
Parameters:
public final Object getDisplayValue()Retrieves the value of the Variant.
public final double getDouble() public final void setDouble(double val)Retrieves and sets the value of this Variant to a double data value.
Parameters:
public final float getFloat() public final void setFloat(float val)Retrieves and sets the value of this Variant to a float data value.
Parameters:
public final int getInt() public final void setInt(int val)Retrieves and sets the value of this Variant to an int data value.
Parameters:
public final long getLong() public final void setLong(long val)Retrieves and sets the value of this Variant to a long data value.
Parameters:
public final boolean isNull() public final void setNull(int nullType)Determines whether a data value is null. If null is true, the data value is null; otherwise, the data value is not null.
public final Object getObject() public final void setObject(java.lang.Object val)Retrieves and sets the value of this Variant to an Object data value.
Parameters:
public final int getSetType()Returns the set type of the Variant as an integer. Possible values are the type constants of Variant. For example, if the data type is boolean, getSetType() returns 11, the value of the BOOLEAN constant. setType is a private variable used internally by the Variant class. It is used to enforce safe set operations.
public final short getShort() public final void setShort(short val)Retrieves and sets the value of this Variant to a short data value.
Parameters:
public final String getString() public final void setString(java.lang.String val)Retrieves and sets the value of this Variant to a String data value.
Parameters:
public final Time getTime() public final void setTime(java.sql.Time val) public final void setTime(long val)Retrieves and sets the value of this Variant to a Time data value.
Parameters:
public final Timestamp getTimestamp() public final void setTimestamp(java.sql.Timestamp val) public final void setTimestamp(long val)Retrieves and sets the value of this Variant to a Timestamp data value.
Parameters:
public final int getType()Returns the data type. The integer returned is the value of one of the type constants of Variant. For example, a data type of double returns a value of 7, which is the value of the DOUBLE constant.
public final boolean isUnassignedNull()Determines whether the data value is an unassigned null. An unassigned null is a value that was never assigned. If unassignedNull is true, the data was not assigned and is null. If it returns false, the data value might not be null or it might be an assigned null value.
public final void setVariant(borland.jbcl.util.Variant value)Sets the value of this Variant to a Variant data value.
Parameters:
public void add(borland.jbcl.util.Variant value2, borland.jbcl.util.Variant result)Adds a value to this Variant, storing the result in the result parameter.
public Object clone()Creates a copy of this Variant, returning the copied object.
Overrides: java.lang.Object.clone()
public int compareTo(borland.jbcl.util.Variant value2)Compares a Variant value to the value of this Variant, returning the result. If the result is zero, the two Variants are equal. If the returned value is less than zero (a negative integer), the value of this Variant is less than value2. If the returned value is greater than zero (a positive integer), the value of this Variant is greater than value2.
Parameters:
public final boolean equals(borland.jbcl.util.Variant value)Determines whether a Variant value is equal to this Variant value. If equals() returns true, the two Variant values are of the same type and are equal in value. A returned value of false indicates that the two values differ in value or type.
Parameters:
public final void setAsDouble(int type, double val)Sets the value of this Variant of a specified type as a double data type.
Parameters:
public final void setAsInt(int type, int val)Sets the value of this Variant of a specified type as an int data type.
Parameters:
public final void setAssignedNull()Sets the value of the Variant as an assigned null. An assigned null is a value that has been explicitly set to null in contrast to one that is simply unassigned.
public final void setByteArray(byte[] val, int length)Sets the value of the Variant to a new array of bytes.
Parameters:
public final void setTimestamp(long val, int nanos)Sets the value of the Variant to a Timestamp value.
Parameters:
public final void setUnassignedNull()Sets the value of this Variant to an unassigned null. An assigned null is a null value that has not been explicitly assigned as null.
public void subtract(borland.jbcl.util.Variant value2, borland.jbcl.util.Variant result)Subtracts a Variant value from the value of this Variant, storing the result in the result parameter.
Parameters:
public final String toString()Converts the Variant value to a string.
Overrides: java.lang.Object.toString()
public static int typeId(java.lang.String name)Returns the integer value that represents the specified type name. For example, a name value of "" returns an integer of 11.
Parameters:
public static String typeName(int type)Returns the name of a data type as a string. For example, the string representation of a BOOLEAN data type is "BOOLEAN".
Parameters:
public static int typeOf(java.lang.String typeName)Returns an integer that identifies the data type specified in the typeName parameter.
Parameters: