public class JVariant
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
cvsRev |
static int |
OPC_QUALITY_BAD |
static int |
OPC_QUALITY_COMM_FAILURE |
static int |
OPC_QUALITY_CONFIG_ERROR |
static int |
OPC_QUALITY_DEVICE_FAILURE |
static int |
OPC_QUALITY_EGU_EXCEEDED |
static int |
OPC_QUALITY_GOOD |
static int |
OPC_QUALITY_LAST_KNOWN |
static int |
OPC_QUALITY_LAST_USABLE |
static int |
OPC_QUALITY_LOCAL_OVERRIDE |
static int |
OPC_QUALITY_NOT_CONNECTED |
static int |
OPC_QUALITY_OUT_OF_SERVICE |
static int |
OPC_QUALITY_SENSOR_CAL |
static int |
OPC_QUALITY_SENSOR_FAILURE |
static int |
OPC_QUALITY_SIMULATED |
static int |
OPC_QUALITY_SUB_NORMAL |
static int |
OPC_QUALITY_UNCERTAIN |
int |
quality
The quality.
|
java.util.Date |
timestamp
The timestamp.
|
java.lang.Object |
value
The current value.
|
int |
variantType
The variant type.
|
static int |
VT_ARRAY |
static int |
VT_BOOL |
static int |
VT_BSTR |
static int |
VT_CY |
static int |
VT_DATE |
static int |
VT_EMPTY |
static int |
VT_I2 |
static int |
VT_I4 |
static int |
VT_R4 |
static int |
VT_R8 |
static int |
VT_UI1 |
static int |
VT_VARIANT |
Constructor and Description |
---|
JVariant()
Create a new object with no value.
|
JVariant(java.lang.Object initialValue)
Create an object with the initial value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object theObject)
Make sure that two defs with the same value are the same.
|
java.lang.Object |
getArrayElementAt(int index)
Returns the element at the index in the array.
|
int |
getArraySize()
Returns the size of the value if it is an array, otherwise zero.
|
java.lang.Object |
getArrayValue()
Returns a string representation of the current value.
|
int |
getBoolValue()
Returns the current value as a boolean.
|
double |
getDoubleValue()
Returns the double representation of the current value.
|
int |
getIntValue()
Returns the integer representation of the current value.
|
int |
getJavaType()
Returns the type of the current value.
|
int |
getQuality() |
java.lang.String |
getStringValue()
Returns a string representation of the current value.
|
java.util.Date |
getTimestamp() |
java.lang.Object |
getValue()
Returns the current value.
|
int |
getVariantType()
Returns the type of the JVariant in the Windows VT_XXX
format.
|
static java.util.Vector |
getVariantTypeNames()
Returns a hash table of the names of all types.
|
static java.util.Hashtable |
getVariantTypes()
Returns a hash table of all types.
|
void |
setArrayElementAt(java.lang.Object element,
int index)
Sets the element at the given index in the value array.
|
void |
setArraySize(int size)
Sets the size of the value array and creates the array.
|
void |
setArrayValue(java.lang.Object array)
Set the current value as an array.
|
void |
setBoolValue(int boolVal)
Sets the current value as a boolean.
|
void |
setDoubleValue(double doubleValue)
Set the current value as an int.
|
void |
setIntValue(int intValue)
Set the current value as an int.
|
void |
setQuality(int quality) |
void |
setStringValue(java.lang.String strValue)
Set the current value as an string.
|
void |
setTimestamp(java.util.Date timestamp) |
void |
setValue(java.lang.Object newValue)
Sets the current value.
|
void |
setVariantType(int type)
Set the type in Windows VT_XXX format.
|
java.lang.String |
toString()
Returns a string representation of this object.
|
public static final java.lang.String cvsRev
public static final int OPC_QUALITY_BAD
public static final int OPC_QUALITY_COMM_FAILURE
public static final int OPC_QUALITY_CONFIG_ERROR
public static final int OPC_QUALITY_DEVICE_FAILURE
public static final int OPC_QUALITY_EGU_EXCEEDED
public static final int OPC_QUALITY_GOOD
public static final int OPC_QUALITY_LAST_KNOWN
public static final int OPC_QUALITY_LAST_USABLE
public static final int OPC_QUALITY_LOCAL_OVERRIDE
public static final int OPC_QUALITY_NOT_CONNECTED
public static final int OPC_QUALITY_OUT_OF_SERVICE
public static final int OPC_QUALITY_SENSOR_CAL
public static final int OPC_QUALITY_SENSOR_FAILURE
public static final int OPC_QUALITY_SIMULATED
public static final int OPC_QUALITY_SUB_NORMAL
public static final int OPC_QUALITY_UNCERTAIN
public int quality
public java.util.Date timestamp
public java.lang.Object value
public int variantType
public static final int VT_ARRAY
public static final int VT_BOOL
public static final int VT_BSTR
public static final int VT_CY
public static final int VT_DATE
public static final int VT_EMPTY
public static final int VT_I2
public static final int VT_I4
public static final int VT_R4
public static final int VT_R8
public static final int VT_UI1
public static final int VT_VARIANT
public JVariant()
public JVariant(java.lang.Object initialValue)
initialValue
- the initial valuepublic boolean equals(java.lang.Object theObject)
equals
in class java.lang.Object
public java.lang.Object getArrayElementAt(int index)
index
- the index into the arraypublic int getArraySize()
public java.lang.Object getArrayValue()
public int getBoolValue()
public double getDoubleValue()
public int getIntValue()
public int getJavaType()
public int getQuality()
public java.lang.String getStringValue()
public java.util.Date getTimestamp()
public java.lang.Object getValue()
public int getVariantType()
public static java.util.Vector getVariantTypeNames()
public static java.util.Hashtable getVariantTypes()
public void setArrayElementAt(java.lang.Object element, int index)
index
- the index into the arrayelement
- JVariant to store at the given indexpublic void setArraySize(int size)
the
- size of the arraypublic void setArrayValue(java.lang.Object array) throws java.lang.IllegalArgumentException
strValue
- the value to storejava.lang.IllegalArgumentException
- if the value passed in is not an arraypublic void setBoolValue(int boolVal)
boolVal
- the value to setpublic void setDoubleValue(double doubleValue)
doubleValue
- the value to storepublic void setIntValue(int intValue)
intValue
- the value to storepublic void setQuality(int quality)
quality
- The quality to set.public void setStringValue(java.lang.String strValue)
strValue
- the value to storepublic void setTimestamp(java.util.Date timestamp)
timestamp
- The timestamp to set.public void setValue(java.lang.Object newValue)
newValue
- the new valuepublic void setVariantType(int type)
type
- the windows type.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.