public interface IDfValue
Value objects provide a convenient way to store variant values, which are values storing the variant datatype. The variant datatype is used to declare variables that can hold one of many different types of data, as in the following example in Visual Basic:
DfValue[] vals = new DfValue[num_attrs];
for (int j = 0; j < num_attrs; j++)
{
vals[j] = myobject.getValue(myobject.getAttr(j).getName());
}
Note that value objects are immutable. Refer to the DocbasicTM User's Guide for more information about the variant datatype. Refer to the Server Reference Manual for more information about value objects.
Modifier and Type | Field and Description |
---|---|
static int |
DF_BOOLEAN
Represents the boolean datatype.
|
static int |
DF_DOUBLE
Represents the double datatype.
|
static int |
DF_ID
Represents the ID datatype.
|
static int |
DF_INTEGER
Represents the integer datatype.
|
static int |
DF_STRING
Represents the string datatype.
|
static int |
DF_TIME
Represents the time datatype.
|
static int |
DF_UNDEFINED
Represents an undefined datatype.
|
Modifier and Type | Method and Description |
---|---|
boolean |
asBoolean()
Returns the contents of a value object as a boolean.
|
double |
asDouble()
Returns the contents of a value object as a double.
|
IDfId |
asId()
Returns the contents of a value object as an
IDfId interface. |
int |
asInteger()
Returns the contents of a value object as a integer.
|
java.lang.String |
asString()
Returns the contents of a value object as a string.
|
IDfTime |
asTime()
Returns the contents of a value object as an
IDfTime interface. |
int |
compareTo(IDfValue value)
Indicates whether the value stored in the calling value object is less than, equal to,
or greater than the value stored in a user-supplied value object.
|
boolean |
equals(java.lang.Object value)
Indicates whether the value stored in the calling value object matches
the value in a user-supplied value object.
|
int |
getDataType()
Returns the datatype of a value stored in a value object.
|
static final int DF_BOOLEAN
static final int DF_INTEGER
static final int DF_STRING
static final int DF_ID
static final int DF_TIME
static final int DF_DOUBLE
static final int DF_UNDEFINED
java.lang.String asString()
int asInteger()
This method returns 0 if the value cannot be converted to an integer.
boolean asBoolean()
This method returns false if the value cannot be converted to a boolean, such as integers other than 0 or 1.
double asDouble()
This method returns 0 if the value cannot be converted to a double, such as a string.
IDfTime asTime()
IDfTime
interface. IDfTime
interfaceIDfId asId()
IDfId
interface. IDfId
interface; Note that if the underlying value is not an object ID,
the return value has no meaning.int getDataType()
Value Datatype 0 Boolean 1 Integer 2 String 3 ID 4 Time, or date 5 Double 6 Undefined
boolean equals(java.lang.Object value)
equals
in class java.lang.Object
value
- an interface to the object containing the value that you want to test; Valid
arguments are IDfValue
, IDfID
, IDfTime
, and the following Java objects: Boolean, Integer, String,
and Double.TRUE
if the values are the same;
FALSE
if they are not.int compareTo(IDfValue value) throws DfException
The following list explains the meaning of all return values:
Value Meaning -1 Less Than 0 Equal To 1 Greater Than
value
- an IDfValue
interface to the object containing the value that you want to test againstDfException
- if the types stored in the value objects do not match or
if this method is called on a value of type booleanCopyright 1994-2023 OpenText Corporation. All rights reserved.