public abstract class ValueObject extends java.lang.Object implements ValueObjectInterface, java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
static int |
defaultTTL
This is the default "time to live".
|
java.util.Locale |
locale
The Locale that this object was created in.
|
static boolean |
traceDefault
Set to true to force connector tracing.
|
static double |
valueForTrue |
ANYTYPE, ARRAYTYPE, BINARYTYPE, BOOLEANTYPE, BYTETYPE, CHARTYPE, DISPLAYVALUE, DOUBLETYPE, FLOATTYPE, GROUP_NAME, INITIALVALUE, INTTYPE, LOG_MESSAGE, LONGTYPE, NAME, OBJECTTYPE, ORDER, PASSWORD_DIGEST, PROPERTYTYPE, QUALITY_BAD, QUALITY_COMM_FAILURE, QUALITY_DEVICE_FAILURE, QUALITY_EGU_EXCEEDED, QUALITY_EVALUATION_EXPIRED, QUALITY_GOOD, QUALITY_IMPOSSIBLE, QUALITY_INITIAL, QUALITY_LAST_USABLE, QUALITY_OUT_OF_SERVICE, QUALITY_PROPERTYONLY, QUALITY_REMOTE_PROXY_INIT, QUALITY_SIMULATED, QUALITY_SOURCE_REMOVED, QUALITY_TRANSITIONAL, QUALITY_UNKNOWN, QUALITY_WARNING, QUALITY_WORST, QUALITY_WRITE_IN_PROGRESS, REQUESTCURRENTVALUE, REQUESTHISTORICAL, SHORTTYPE, STRINGTYPE, TRACE, TWODTYPE, UNSIGNEDBYTETYPE, UNSIGNEDINTTYPE, UNSIGNEDLONGTYPE, UNSIGNEDSHORTTYPE, USER_NAME| Constructor and Description |
|---|
ValueObject()
Generic constructor.
|
ValueObject(java.util.Locale locale)
Generic constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
acquireLatestPropertiesFrom(ValueObjectInterface target,
ValueObjectInterface source1,
ValueObjectInterface source2)
This method will do an "acquirePropertiesFrom" on both the incoming
values.
|
void |
acquirePropertiesFrom(ValueObjectInterface source)
Copies many of the attributes from this object to the target object.
|
java.util.Enumeration<java.lang.String> |
attributeNames()
This will return an enumeration of all the current keys.
|
int |
compareTo(ValueObjectInterface otherValueObject)
This is our implementation (for JDK 1.1 compatibility) of the Comparable
interface of Java 2.
|
ValueObjectInterface |
convertToLowestPrecisionNumber()
This returns the ValueObject unadulterated.
|
int |
decrementTTL()
Decrements and returns the current value of the ttl field.
|
boolean |
equals(java.lang.Object obj)
Compare the string values
|
static java.lang.String |
escapeJSON(java.lang.String original) |
boolean |
getAlwaysSend()
This is if you always want this value to be send to the client...
|
byte[] |
getBinaryValue()
This will return the current value of the ValueObject as a byte array.
|
java.awt.Color |
getColor()
This will return the color associated with the current value.
|
java.util.Date |
getDate()
This is the date and time when the value was created.
|
java.util.Locale |
getLocale()
This method returns the Locale that this object was created in.
|
static ValueObjectInterface |
getLowestPrecisionValueObject(java.lang.String value)
Returns the lowest precision value object that the string can be
converted to.
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Return a copy of the properties map.
|
java.lang.Object |
getProperty(java.lang.String attribute)
This is additional information that is sent with the property.
|
int |
getQuality()
This is the quality of the reading.
|
static java.lang.String |
getQualityString(int quality)
Returns a descriptive string for the given quality.
|
double |
getTime()
this will return the date as a double ((double)date.getTime())/1000
|
long |
getTimeMillis()
This will return the number of milliseconds since Jan 1st 1970.
|
int |
getTTL() |
char |
getType()
Returns a 'C','Z', 'B', 'I', 'F', 'J', 'S', 'D', 'L', or 's' depending on if the
currentValue was set as a char, boolean, byte, int, float, long, short, double, serializable object, or a string.
|
static ValueObjectInterface |
getValueObject(boolean newValue)
Static method that will return a LongValueObject generated from the newValue.
|
static ValueObjectInterface |
getValueObject(byte newValue)
Static method that will return a LongValueObject generated from the newValue.
|
static ValueObjectInterface |
getValueObject(char newValue)
Static method that will return a LongValueObject generated from the newValue.
|
static ValueObjectInterface |
getValueObject(java.awt.Color color)
Static method that will return a GenericValueObject generated from the
Color.
|
static ValueObjectInterface |
getValueObject(double newValue)
Static method that will return a DoubleValueObject generated from the newValue.
|
static ValueObjectInterface |
getValueObject(float newValue)
Static method that will return a DoubleValueObject generated from the newValue.
|
static ValueObjectInterface |
getValueObject(int newValue)
Static method that will return a LongValueObject generated from the newValue.
|
static ValueObjectInterface |
getValueObject(long newValue)
Static method that will return a LongValueObject generated from the newValue.
|
static ValueObjectInterface |
getValueObject(java.lang.Object newValue) |
static ValueObjectInterface |
getValueObject(short newValue)
Static method that will return a LongValueObject generated from the newValue.
|
static ValueObjectInterface |
getValueObject(java.lang.String newValue)
Static method that will return a StringValueObject generated from the newValue.
|
int |
hashCode() |
boolean |
replaces(ValueObjectInterface oldValue,
double deadband)
this is used to determine if we should send this valueobject to
replace oldValue.
|
void |
setAlwaysSend(boolean newValue)
This is if you always want this value to be send to the client...
|
void |
setColor(java.awt.Color newColor)
Sets the color object.
|
void |
setDate(java.util.Date newValue)
This is the date and time when the value was created.
|
void |
setLocale(java.util.Locale locale)
Sets the locale.
|
void |
setProperty(java.lang.String attribute,
java.lang.Object value)
This is additional information that is sent with the property.
|
void |
setQuality(int quality)
This is the quality of the reading.
|
void |
setTimeMillis(long timeMillis)
This will set the time as the number of milliseconds since Jan 1st 1970.
|
void |
setTTL(int ttl) |
void |
setType(char newValue)
This allows people to specify what type a specific subclass represents.
|
static void |
setValueForTrue(double newValue)
This will change the default value for true (when someone creates a valueobject
sending the parameter of true, or the default hi value on a box.
|
static boolean |
shouldTrace(ValueObjectInterface value)
Returns true if the TRACE parameter is set and starts with a 'y' or 'Y'
|
java.lang.String |
toJSON()
Build a json representation of the object, structured:
{
"type": "object"|"array"|"2d",
"value": \
|
java.lang.String |
toJSON(boolean incFormatted,
boolean stringDate)
Build a json representation of the object, structured:
{
"type": "object"|"array"|"2d",
"value": \
|
java.lang.String |
toJSON(boolean incFormatted,
boolean stringDate,
java.lang.String dateFormat)
Build a json representation of the object, structured:
{
"type": "object"|"array"|"2d",
"value": \
|
java.lang.String |
toString()
This will display the value as a string.
|
copy, getBoolValue, getByteValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getNumericValue, getObjectValue, getShortValue, getStringValuepublic static int defaultTTL
ttlpublic java.util.Locale locale
public static boolean traceDefault
public static double valueForTrue
public ValueObject()
public ValueObject(java.util.Locale locale)
public static void acquireLatestPropertiesFrom(ValueObjectInterface target, ValueObjectInterface source1, ValueObjectInterface source2)
public void acquirePropertiesFrom(ValueObjectInterface source)
acquirePropertiesFrom in interface ValueObjectInterfacetarget - the target of the copypublic java.util.Enumeration<java.lang.String> attributeNames()
attributeNames in interface ValueObjectInterfacepublic int compareTo(ValueObjectInterface otherValueObject)
compareTo in interface ValueObjectInterfaceotherValueObject - the object to be compared topublic ValueObjectInterface convertToLowestPrecisionNumber()
convertToLowestPrecisionNumber in interface ValueObjectInterfaceStringValueObjectpublic int decrementTTL()
decrementTTL in interface ValueObjectInterfacepublic boolean equals(java.lang.Object obj)
equals in interface ValueObjectInterfaceequals in class java.lang.Objectpublic static java.lang.String escapeJSON(java.lang.String original)
public boolean getAlwaysSend()
getAlwaysSend in interface ValueObjectInterfaceValueObjectInterface.setAlwaysSend(boolean)public byte[] getBinaryValue()
getBinaryValue in interface ValueObjectInterfacepublic java.awt.Color getColor()
getColor in interface ValueObjectInterfacepublic java.util.Date getDate()
getDate in interface ValueObjectInterfacesetDate(java.util.Date)public java.util.Locale getLocale()
getLocale in interface ValueObjectInterfacepublic static ValueObjectInterface getLowestPrecisionValueObject(java.lang.String value)
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
public java.lang.Object getProperty(java.lang.String attribute)
getProperty in interface ValueObjectInterfaceattribute - additional informationsetProperty(java.lang.String, java.lang.Object)public int getQuality()
getQuality in interface ValueObjectInterfaceValueObjectInterface.setQuality(int)public static java.lang.String getQualityString(int quality)
public double getTime()
getTime in interface ValueObjectInterfacepublic long getTimeMillis()
getTimeMillis in interface ValueObjectInterfacepublic int getTTL()
getTTL in interface ValueObjectInterfacepublic char getType()
getType in interface ValueObjectInterfacepublic static ValueObjectInterface getValueObject(boolean newValue)
public static ValueObjectInterface getValueObject(byte newValue)
public static ValueObjectInterface getValueObject(char newValue)
public static ValueObjectInterface getValueObject(java.awt.Color color)
getColor will be
the color parameter as will the value of the value object.color - the color stored in the value object as well as the value of the objectpublic static ValueObjectInterface getValueObject(double newValue)
public static ValueObjectInterface getValueObject(float newValue)
public static ValueObjectInterface getValueObject(int newValue)
public static ValueObjectInterface getValueObject(long newValue)
public static ValueObjectInterface getValueObject(java.lang.Object newValue)
public static ValueObjectInterface getValueObject(short newValue)
public static ValueObjectInterface getValueObject(java.lang.String newValue)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean replaces(ValueObjectInterface oldValue, double deadband)
replaces in interface ValueObjectInterfacepublic void setAlwaysSend(boolean newValue)
setAlwaysSend in interface ValueObjectInterfacenewValue - a boolean setting the "always send" stateValueObjectInterface.getAlwaysSend()public void setColor(java.awt.Color newColor)
setColor in interface ValueObjectInterfacenewColor - The color associated with the current value.public void setDate(java.util.Date newValue)
setDate in interface ValueObjectInterfacegetDate()public void setLocale(java.util.Locale locale)
locale - The locale to set.public void setProperty(java.lang.String attribute,
java.lang.Object value)
setProperty in interface ValueObjectInterfaceattribute - the attribute Stringvalue - the Serializable value of this attribute#getValuepublic void setQuality(int quality)
setQuality in interface ValueObjectInterfacequality - the data qualityValueObjectInterface.getQuality()public void setTimeMillis(long timeMillis)
setTimeMillis in interface ValueObjectInterfacepublic void setTTL(int ttl)
setTTL in interface ValueObjectInterfacettl - The ttl to set.public void setType(char newValue)
setType in interface ValueObjectInterfacepublic static void setValueForTrue(double newValue)
public static boolean shouldTrace(ValueObjectInterface value)
public java.lang.String toJSON()
ValueObjectInterfacetoJSON in interface ValueObjectInterfacepublic java.lang.String toJSON(boolean incFormatted,
boolean stringDate)
incFormatted - true if the string value of this value object is to be provided under the "formattedValue" keystringDate - if true, the "timestamp" key will be a String of the form "yyyy-MM-dd HH:mm:ss.zzz"public java.lang.String toJSON(boolean incFormatted,
boolean stringDate,
java.lang.String dateFormat)
incFormatted - true if the string value of this value object is to be provided under the "formattedValue" keystringDate - if true, the "timestamp" key will be a String of the form "yyyy-MM-dd HH:mm:ss.zzz"public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 1999-2025 ErgoTech Systems, Inc. All Rights Reserved.