public class ValueFactory extends Object
The factory methods do not do anything in terms of defensive copy and immutability to the objects, which they are passed as they are. It's the client responsibility to prepare them appropriately, which is automatically done anyway for all objects except collections.
Constructor and Description |
---|
ValueFactory() |
Modifier and Type | Method and Description |
---|---|
static Alarm |
alarmNone()
No alarm.
|
static Display |
displayBoolean()
Returns a display from 0 to 1, suitable for booleans.
|
static Display |
displayNone()
Empty display information.
|
static VNumberArray |
ndArray(VNumberArray data,
ArrayDimensionDisplay... dimensions)
Constructs and nd array with the data, time and alarm in the first array and the given
dimension information.
|
static Alarm |
newAlarm(AlarmSeverity alarmSeverity,
String alarmName)
New alarm with the given severity and status.
|
static Alarm |
newAlarm(Number value,
Display display)
Alarm based on the value and the display ranges.
|
static Display |
newDisplay(Double lowerDisplayLimit,
Double lowerAlarmLimit,
Double lowerWarningLimit,
String units,
NumberFormat numberFormat,
Double upperWarningLimit,
Double upperAlarmLimit,
Double upperDisplayLimit,
Double lowerCtrlLimit,
Double upperCtrlLimit)
Creates a new display
|
static ArrayDimensionDisplay |
newDisplay(int nCells)
Returns an array display where the index is used to calculate the
cell boundaries.
|
static ArrayDimensionDisplay |
newDisplay(int size,
ListNumberProvider boundaryProvider) |
static ArrayDimensionDisplay |
newDisplay(int size,
ListNumberProvider boundaryProvider,
boolean invert) |
static ArrayDimensionDisplay |
newDisplay(org.epics.util.array.ListNumber boundaries,
boolean reversed,
String unit) |
static ArrayDimensionDisplay |
newDisplay(org.epics.util.array.ListNumber boundaries,
String unit) |
static Time |
newTime(org.epics.util.time.Timestamp timestamp)
New time, with no user tag and valid data.
|
static Time |
newTime(org.epics.util.time.Timestamp timestamp,
Integer timeUserTag,
boolean timeValid)
Creates a new time.
|
static VBoolean |
newVBoolean(boolean value,
Alarm alarm,
Time time)
Creates a new VBoolean.
|
static VBooleanArray |
newVBooleanArray(org.epics.util.array.ListBoolean data,
Alarm alarm,
Time time)
Creates a new VBooleanArray.
|
static VByte |
newVByte(Byte value,
Alarm alarm,
Time time,
Display display)
Creates a new VByte.
|
static VDouble |
newVDouble(Double value)
Creates a new VDouble, no alarm, time now, no display.
|
static VDouble |
newVDouble(Double value,
Alarm alarm,
Time time,
Display display)
Creates a new VDouble.
|
static VDouble |
newVDouble(Double value,
Display display)
Creates new immutable VDouble by using metadata from the old value,
now as timestamp and computing alarm from the metadata range.
|
static VDouble |
newVDouble(Double value,
Time time)
Creates a new VDouble, no alarm, no display.
|
static VDouble |
newVDouble(Double value,
Time time,
Display display)
Creates a new VDouble using the given value, time, display and
generating the alarm from the value and display information.
|
static VDoubleArray |
newVDoubleArray(org.epics.util.array.ListDouble data,
Alarm alarm,
Time time,
Display display)
Creates a new VDoubleArray.
|
static VEnum |
newVEnum(int index,
List<String> labels,
Alarm alarm,
Time time)
Create a new VEnum.
|
static VEnumArray |
newVEnumArray(org.epics.util.array.ListInt indexes,
List<String> labels,
Alarm alarm,
Time time)
Create a new VEnumArray.
|
static VFloat |
newVFloat(Float value,
Alarm alarm,
Time time,
Display display)
Creates a new VFloat.
|
static VFloatArray |
newVFloatArray(org.epics.util.array.ListFloat data,
Alarm alarm,
Time time,
Display display)
Creates a new VFloatArray.
|
static VImage |
newVImage(int height,
int width,
byte[] data)
Creates a new VImage given the data and the size.
|
static VInt |
newVInt(Integer value,
Alarm alarm,
Time time,
Display display)
Creates a new VInt.
|
static VIntArray |
newVIntArray(org.epics.util.array.ListInt values,
Alarm alarm,
Time time,
Display display)
Creates a new VIntArray.
|
static VLong |
newVLong(Long value,
Alarm alarm,
Time time,
Display display)
Creates a new VLong.
|
static VLongArray |
newVLongArray(org.epics.util.array.ListLong values,
Alarm alarm,
Time time,
Display display)
Creates a new VLongArray.
|
static VMultiDouble |
newVMultiDouble(List<VDouble> values,
Alarm alarm,
Time time,
Display display)
Creates a new VMultiDouble.
|
static VNumber |
newVNumber(Number value,
Alarm alarm,
Time time,
Display display)
Creates a new VNumber based on the type of the data
|
static VNumberArray |
newVNumberArray(org.epics.util.array.ListNumber data,
Alarm alarm,
Time time,
Display display)
Creates a new VNumberArray based on the type of the data.
|
static VNumberArray |
newVNumberArray(org.epics.util.array.ListNumber data,
org.epics.util.array.ListInt sizes,
List<ArrayDimensionDisplay> dimensionDisplay,
Alarm alarm,
Time time,
Display display)
Creates a new VNumberArray based on the type of the data.
|
static VShort |
newVShort(Short value,
Alarm alarm,
Time time,
Display display)
Creates a new VShort.
|
static VShortArray |
newVShortArray(org.epics.util.array.ListShort values,
Alarm alarm,
Time time,
Display display)
Creates a new VShortArray.
|
static VStatistics |
newVStatistics(double average,
double stdDev,
double min,
double max,
int nSamples,
Alarm alarm,
Time time,
Display display)
Creates a new VStatistics.
|
static VString |
newVString(String value,
Alarm alarm,
Time time)
Creates a new VString.
|
static VStringArray |
newVStringArray(List<String> data,
Alarm alarm,
Time time)
Creates a new VStringArray.
|
static VTable |
newVTable(List<Class<?>> types,
List<String> names,
List<Object> values)
Creates a new VTable - this method is provisional and will change in the future.
|
static Time |
timeNow()
New time with the current timestamp, no user tag and valid data.
|
static VType |
toVType(Object javaObject)
Converts a standard java type to VTypes.
|
static VType |
toVType(Object javaObject,
Alarm alarm,
Time time,
Display display)
Converts a standard java type to VTypes.
|
static VType |
toVTypeChecked(Object javaObject)
As
toVType(java.lang.Object) but throws an exception
if conversion not possible. |
static VType |
toVTypeChecked(Object javaObject,
Alarm alarm,
Time time,
Display display)
As
toVType(java.lang.Object, org.epics.vtype.Alarm, org.epics.vtype.Time, org.epics.vtype.Display) but throws an exception
if conversion not possible. |
static VType |
wrapValue(Object value)
Deprecated.
|
static VType |
wrapValue(Object value,
Alarm alarm)
|
public static VString newVString(String value, Alarm alarm, Time time)
value
- the string valuealarm
- the alarmtime
- the timepublic static VBoolean newVBoolean(boolean value, Alarm alarm, Time time)
value
- the boolean valuealarm
- the alarmtime
- the timepublic static VMultiDouble newVMultiDouble(List<VDouble> values, Alarm alarm, Time time, Display display)
values
- the valuesalarm
- the alarmtime
- the timedisplay
- the displaypublic static VLong newVLong(Long value, Alarm alarm, Time time, Display display)
value
- the valuealarm
- the alarmtime
- the timedisplay
- the displaypublic static VInt newVInt(Integer value, Alarm alarm, Time time, Display display)
value
- the valuealarm
- the alarmtime
- the timedisplay
- the displaypublic static VShort newVShort(Short value, Alarm alarm, Time time, Display display)
value
- the valuealarm
- the alarmtime
- the timedisplay
- the displaypublic static VByte newVByte(Byte value, Alarm alarm, Time time, Display display)
value
- the valuealarm
- the alarmtime
- the timedisplay
- the displaypublic static Alarm newAlarm(AlarmSeverity alarmSeverity, String alarmName)
alarmSeverity
- the alarm severityalarmName
- the alarm namepublic static Alarm alarmNone()
public static Alarm newAlarm(Number value, Display display)
value
- the valuedisplay
- the display informationpublic static Time newTime(org.epics.util.time.Timestamp timestamp, Integer timeUserTag, boolean timeValid)
timestamp
- the timestamptimeUserTag
- the user tagtimeValid
- whether the time is validpublic static Time newTime(org.epics.util.time.Timestamp timestamp)
timestamp
- the timestamppublic static Time timeNow()
public static Display newDisplay(Double lowerDisplayLimit, Double lowerAlarmLimit, Double lowerWarningLimit, String units, NumberFormat numberFormat, Double upperWarningLimit, Double upperAlarmLimit, Double upperDisplayLimit, Double lowerCtrlLimit, Double upperCtrlLimit)
lowerDisplayLimit
- lower display limitlowerAlarmLimit
- lower alarm limitlowerWarningLimit
- lower warning limitunits
- the unitsnumberFormat
- the formatterupperWarningLimit
- the upper warning limitupperAlarmLimit
- the upper alarm limitupperDisplayLimit
- the upper display limitlowerCtrlLimit
- the lower control limitupperCtrlLimit
- the upper control limitpublic static ArrayDimensionDisplay newDisplay(org.epics.util.array.ListNumber boundaries, String unit)
public static ArrayDimensionDisplay newDisplay(org.epics.util.array.ListNumber boundaries, boolean reversed, String unit)
public static ArrayDimensionDisplay newDisplay(int size, ListNumberProvider boundaryProvider, boolean invert)
public static ArrayDimensionDisplay newDisplay(int size, ListNumberProvider boundaryProvider)
public static ArrayDimensionDisplay newDisplay(int nCells)
nCells
- the number of cells along the directionpublic static Display displayNone()
public static Display displayBoolean()
public static VNumber newVNumber(Number value, Alarm alarm, Time time, Display display)
value
- the valuealarm
- the alarmtime
- the timedisplay
- the displaypublic static VDouble newVDouble(Double value, Alarm alarm, Time time, Display display)
value
- the valuealarm
- the alarmtime
- the timedisplay
- the displaypublic static VDouble newVDouble(Double value, Time time, Display display)
value
- the new valuetime
- the timedisplay
- the display informationpublic static VDouble newVDouble(Double value, Display display)
value
- new numeric valuedisplay
- metadatapublic static VDouble newVDouble(Double value)
value
- the valuepublic static VDouble newVDouble(Double value, Time time)
value
- the valuetime
- the timepublic static VFloat newVFloat(Float value, Alarm alarm, Time time, Display display)
value
- the valuealarm
- the alarmtime
- the timedisplay
- the displaypublic static VEnum newVEnum(int index, List<String> labels, Alarm alarm, Time time)
index
- the index in the label arraylabels
- the labelsalarm
- the alarmtime
- the timepublic static VStatistics newVStatistics(double average, double stdDev, double min, double max, int nSamples, Alarm alarm, Time time, Display display)
average
- averagestdDev
- standard deviationmin
- minimummax
- maximumnSamples
- number of samplesalarm
- the alarmtime
- the timedisplay
- the displaypublic static VNumberArray newVNumberArray(org.epics.util.array.ListNumber data, Alarm alarm, Time time, Display display)
data
- the array dataalarm
- the alarmtime
- the timedisplay
- the displaypublic static VNumberArray newVNumberArray(org.epics.util.array.ListNumber data, org.epics.util.array.ListInt sizes, List<ArrayDimensionDisplay> dimensionDisplay, Alarm alarm, Time time, Display display)
data
- the array datasizes
- the array shapedimensionDisplay
- the array axis display informationalarm
- the alarmtime
- the timedisplay
- the displaypublic static VNumberArray ndArray(VNumberArray data, ArrayDimensionDisplay... dimensions)
data
- the array with the datadimensions
- the dimension informationpublic static VDoubleArray newVDoubleArray(org.epics.util.array.ListDouble data, Alarm alarm, Time time, Display display)
data
- array dataalarm
- the alarmtime
- the timedisplay
- the displaypublic static VFloatArray newVFloatArray(org.epics.util.array.ListFloat data, Alarm alarm, Time time, Display display)
data
- array dataalarm
- the alarmtime
- the timedisplay
- the displaypublic static VImage newVImage(int height, int width, byte[] data)
height
- the heightwidth
- the widthdata
- the datapublic static VLongArray newVLongArray(org.epics.util.array.ListLong values, Alarm alarm, Time time, Display display)
values
- array valuesalarm
- the alarmtime
- the timedisplay
- the displaypublic static VIntArray newVIntArray(org.epics.util.array.ListInt values, Alarm alarm, Time time, Display display)
values
- array valuesalarm
- the alarmtime
- the timedisplay
- the displaypublic static VShortArray newVShortArray(org.epics.util.array.ListShort values, Alarm alarm, Time time, Display display)
values
- array valuesalarm
- the alarmtime
- the timedisplay
- the displaypublic static VEnumArray newVEnumArray(org.epics.util.array.ListInt indexes, List<String> labels, Alarm alarm, Time time)
indexes
- the indexes in the label arraylabels
- the labelsalarm
- the alarmtime
- the timepublic static VBooleanArray newVBooleanArray(org.epics.util.array.ListBoolean data, Alarm alarm, Time time)
data
- the stringsalarm
- the alarmtime
- the timepublic static VStringArray newVStringArray(List<String> data, Alarm alarm, Time time)
data
- the stringsalarm
- the alarmtime
- the timepublic static VTable newVTable(List<Class<?>> types, List<String> names, List<Object> values)
types
- the types for each columnnames
- the names for each columnvalues
- the values for each column@Deprecated public static VType wrapValue(Object value)
toVType(java.lang.Object)
value
- the value to wrap@Deprecated public static VType wrapValue(Object value, Alarm alarm)
toVType(java.lang.Object, org.epics.vtype.Alarm, org.epics.vtype.Time, org.epics.vtype.Display)
value
- the value to wrapalarm
- the alarm for the valuepublic static VType toVType(Object javaObject)
toVType(java.lang.Object, org.epics.vtype.Alarm, org.epics.vtype.Time, org.epics.vtype.Display)
with no alarm, time now and no display.javaObject
- the value to wrappublic static VType toVType(Object javaObject, Alarm alarm, Time time, Display display)
Types are converted as follow:
javaObject
- the value to wrapalarm
- the alarmtime
- the timedisplay
- the displaypublic static VType toVTypeChecked(Object javaObject)
toVType(java.lang.Object)
but throws an exception
if conversion not possible.javaObject
- the value to wrappublic static VType toVTypeChecked(Object javaObject, Alarm alarm, Time time, Display display)
toVType(java.lang.Object, org.epics.vtype.Alarm, org.epics.vtype.Time, org.epics.vtype.Display)
but throws an exception
if conversion not possible.javaObject
- the value to wrapalarm
- the alarmtime
- the timedisplay
- the displayCopyright © 2010–2015. All rights reserved.