public class ValueUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static Alarm |
alarmOf(Object obj)
Extracts the alarm information if present.
|
static Alarm |
alarmOf(Object value,
boolean connected)
Extracts the alarm information if present, based on value
and connection status.
|
static int |
colorFor(AlarmSeverity severity)
Returns the rgb value for the given severity.
|
static List<ArrayDimensionDisplay> |
defaultArrayDisplay(ListInt sizes)
Returns the default array dimension display given the size
of the n dimensional array and creating cell boundaries based on index.
|
static List<ArrayDimensionDisplay> |
defaultArrayDisplay(VNumberArray array)
Returns the default array dimension display by looking at the size
of the n dimensional array and creating cell boundaries based on index.
|
static boolean |
displayEquals(Display d1,
Display d2)
Returns true if the two displays contain the same information.
|
static boolean |
displayHasValidDisplayLimits(Display display)
Checks whether the display limits are non-null and non-NaN.
|
static Display |
displayOf(Object obj)
Extracts the display information if present.
|
static NumberFormat |
getDefaultNumberFormat()
The default format for numbers.
|
static TimestampFormat |
getDefaultTimestampFormat()
The default object to format and parse timestamps.
|
static ValueFormat |
getDefaultValueFormat()
The default format for VTypes.
|
static Alarm |
highestSeverityOf(List<Object> args,
boolean considerNull)
Returns the alarm with highest severity.
|
static Time |
latestTimeOf(List<Object> args)
Returns the time with latest timestamp.
|
static Time |
latestValidTimeOrNowOf(List<Object> args)
Returns the time with latest valid timestamp or now.
|
static Double |
normalize(Number value,
Display display)
Normalizes the given value according to the given display information.
|
static Double |
normalize(Number value,
Number lowValue,
Number highValue)
Normalizes the given value according to the given range;
|
static Double |
normalizedNumericValueOf(Object obj)
Extracts the numericValueOf the object and normalizes according
to the display range.
|
static ListNumber |
numericColumnOf(VTable table,
String columnName)
Extracts the values of a column, making sure it contains
numeric values.
|
static Double |
numericValueOf(Object obj)
Extracts a numeric value for the object.
|
static void |
setAlarmSeverityColorMap(Map<AlarmSeverity,Integer> map)
Changes the color map for AlarmSeverity.
|
static void |
setDefaultNumberFormat(NumberFormat defaultNumberFormat)
Changes the default format for numbers.
|
static void |
setDefaultTimestampFormat(TimestampFormat defaultTimestampFormat)
Changes the default timestamp format.
|
static void |
setDefaultValueFormat(ValueFormat defaultValueFormat)
Changes the default format for VTypes.
|
static List<String> |
stringColumnOf(VTable table,
String columnName)
Extracts the values of a column, making sure it contains
strings.
|
static VNumberArray |
subArray(VNumberArray array,
int index)
Filters an element of a one-dimensional array.
|
static Time |
timeOf(Object obj)
Extracts the time information if present.
|
static BufferedImage |
toImage(VImage vImage)
Converts a VImage to an AWT BufferedImage, so that it can be displayed.
|
static VImage |
toVImage(BufferedImage image)
Converts an AWT BufferedImage to a VImage.
|
static Class<?> |
typeOf(Object obj)
Returns the type of the object by returning the class object of one
of the VXxx interfaces.
|
public static Class<?> typeOf(Object obj)
obj - an object implementing a standard typepublic static Alarm alarmOf(Object obj)
obj - an object implementing a standard typepublic static Alarm alarmOf(Object value, boolean connected)
value - a valueconnected - the connection statuspublic static Alarm highestSeverityOf(List<Object> args, boolean considerNull)
args - a list of valuesconsiderNull - whether to consider null valuespublic static Time latestTimeOf(List<Object> args)
args - a list of valuespublic static Time latestValidTimeOrNowOf(List<Object> args)
args - a list of valuespublic static Time timeOf(Object obj)
obj - an object implementing a standard typepublic static Display displayOf(Object obj)
obj - an object implementing a standard typepublic static boolean displayHasValidDisplayLimits(Display display)
display - a displaypublic static Double normalizedNumericValueOf(Object obj)
obj - an object implementing a standard typepublic static Double normalize(Number value, Display display)
value - a valuedisplay - the display informationpublic static Double normalize(Number value, Number lowValue, Number highValue)
value - a valuelowValue - the lowest value in the rangehighValue - the highest value in the rangepublic static Double numericValueOf(Object obj)
obj - an object implementing a standard typepublic static BufferedImage toImage(VImage vImage)
vImage - the image to be convertedpublic static VImage toVImage(BufferedImage image)
Currently, only TYPE_3BYTE_BGR is supported
image - public static boolean displayEquals(Display d1, Display d2)
d1 - the first displayd2 - the second displaypublic static void setAlarmSeverityColorMap(Map<AlarmSeverity,Integer> map)
map - the new color mappublic static int colorFor(AlarmSeverity severity)
severity - an alarm severitypublic static TimestampFormat getDefaultTimestampFormat()
public static void setDefaultTimestampFormat(TimestampFormat defaultTimestampFormat)
defaultTimestampFormat - the new default timestamp formatpublic static NumberFormat getDefaultNumberFormat()
public static void setDefaultNumberFormat(NumberFormat defaultNumberFormat)
defaultNumberFormat - the new default number formatpublic static ValueFormat getDefaultValueFormat()
public static void setDefaultValueFormat(ValueFormat defaultValueFormat)
defaultValueFormat - the new default formatpublic static ListNumber numericColumnOf(VTable table, String columnName)
table - a tablecolumnName - the name of the column to extractIllegalArgumentException - if the column is found but does not contain numeric valuespublic static List<String> stringColumnOf(VTable table, String columnName)
table - a tablecolumnName - the name of the column to extractIllegalArgumentException - if the column is found but does not contain string valuespublic static List<ArrayDimensionDisplay> defaultArrayDisplay(VNumberArray array)
array - the arraypublic static List<ArrayDimensionDisplay> defaultArrayDisplay(ListInt sizes)
sizes - the shape of the arraypublic static VNumberArray subArray(VNumberArray array, int index)
array - a 1D arrayindex - a valid indexCopyright © 2015. All rights reserved.