|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.csstudio.data.values.ValueUtil
public class ValueUtil
Helper for decoding the data in a IValue
,
mostly for display purposes.
Constructor Summary | |
---|---|
ValueUtil()
|
Method Summary | |
---|---|
static java.lang.String |
formatValueAndSeverity(IValue value)
|
static double |
getDouble(IValue value)
Try to get a double number from the Value. |
static double |
getDouble(IValue value,
int index)
Try to get a double-typed array element from the Value. |
static double[] |
getDoubleArray(IValue value)
Try to get a double-typed array from the Value. |
static java.lang.String |
getInfo(IValue value)
Deprecated. Remove. Only used in old Data Browser?? |
static int |
getSize(IValue value)
|
static java.lang.String |
getString(IValue value)
Converts the given value into a string representation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValueUtil()
Method Detail |
---|
public static int getSize(IValue value)
1
for scalars.public static double getDouble(IValue value)
Some applications only deal with numeric data, so they want to interprete integer, enum and double values all the same.
value
- The value to decode.
Double.NaN
in case the value type
does not decode into a number, or
Double.NEGATIVE_INFINITY
if the value's severity
indicates that there happens to be no useful value.public static double getDouble(IValue value, int index)
value
- The value to decode.index
- The array index, 0 ... getSize()-1.
Double.NaN
in case the value type
does not decode into a number, or
Double.NEGATIVE_INFINITY
if the value's severity
indicates that there happens to be no useful value.#getSize(Value)
,
#getDouble(Value)
public static double[] getDoubleArray(IValue value)
value
- The value to decode.
#getSize(Value)
,
#getDouble(Value)
@Deprecated public static java.lang.String getInfo(IValue value)
For numeric values, which is probably the vast majority of all values, this is the severity and status information.
For 'enum' type values, getDouble()
will return
the numeric value, and getInfo()
returns the associated
enumeration string, appended to a possible severity/status text.
For string type values, this is the string value and
a possible severity/status text,
while getDouble()
will return NaN
.
value
- The value to decode.
null
.public static java.lang.String formatValueAndSeverity(IValue value)
null
String for the value and its
severity/status. Does not include the time stamp.Value#format()
,
#getInfo(Value)
public static java.lang.String getString(IValue value)
IValue.format()
method is called and its result returned.
value
- the value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |