org.epics.pvmanager.data
Class ValueFactory

java.lang.Object
  extended by org.epics.pvmanager.data.ValueFactory

public class ValueFactory
extends java.lang.Object

Factory class for all concrete implementation of the types.

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.

Author:
carcassi

Constructor Summary
ValueFactory()
           
 
Method Summary
static Alarm alarmNone()
          No alarm.
static Display displayNone()
          Empty display information.
static Alarm newAlarm(AlarmSeverity alarmSeverity, AlarmStatus alarmStatus)
          New alarm with the given severity and status.
static Alarm newAlarm(java.lang.Number value, Display display)
          Alarm based on the value and the display ranges.
static Display newDisplay(java.lang.Double lowerDisplayLimit, java.lang.Double lowerAlarmLimit, java.lang.Double lowerWarningLimit, java.lang.String units, java.text.NumberFormat numberFormat, java.lang.Double upperWarningLimit, java.lang.Double upperAlarmLimit, java.lang.Double upperDisplayLimit, java.lang.Double lowerCtrlLimit, java.lang.Double upperCtrlLimit)
          Creates a new display
static VInt newEInt(java.lang.Integer value, AlarmSeverity alarmSeverity, AlarmStatus alarmStatus, java.lang.Integer timeUserTag, TimeStamp timeStamp, VInt oldValue)
          Deprecated. use newVInt(java.lang.Integer, org.epics.pvmanager.data.Alarm, org.epics.pvmanager.data.Time, org.epics.pvmanager.data.Display).
static VInt newEInt(java.lang.Integer value, AlarmSeverity alarmSeverity, AlarmStatus alarmStatus, TimeStamp timeStamp, java.lang.Integer timeUserTag, java.lang.Double lowerDisplayLimit, java.lang.Double lowerAlarmLimit, java.lang.Double lowerWarningLimit, java.lang.String units, java.text.NumberFormat numberFormat, java.lang.Double upperWarningLimit, java.lang.Double upperAlarmLimit, java.lang.Double upperDisplayLimit, java.lang.Double lowerCtrlLimit, java.lang.Double upperCtrlLimit)
          Deprecated. use newVInt(java.lang.Integer, org.epics.pvmanager.data.Alarm, org.epics.pvmanager.data.Time, org.epics.pvmanager.data.Display).
static Time newTime(Timestamp timestamp)
          New time, with no user tag and valid data.
static Time newTime(Timestamp timestamp, java.lang.Integer timeUserTag, boolean timeValid)
          Creates a new time.
static VDouble newVDouble(java.lang.Double value)
          Creates a new VDouble, no alarm, time now, no display.
static VDouble newVDouble(java.lang.Double value, AlarmSeverity alarmSeverity, AlarmStatus alarmStatus, java.lang.Integer timeUserTag, TimeStamp timeStamp, Display display)
          Deprecated.  
static VDouble newVDouble(java.lang.Double value, AlarmSeverity alarmSeverity, AlarmStatus alarmStatus, TimeStamp timeStamp, java.lang.Integer timeUserTag, java.lang.Double lowerDisplayLimit, java.lang.Double lowerAlarmLimit, java.lang.Double lowerWarningLimit, java.lang.String units, java.text.NumberFormat numberFormat, java.lang.Double upperWarningLimit, java.lang.Double upperAlarmLimit, java.lang.Double upperDisplayLimit, java.lang.Double lowerCtrlLimit, java.lang.Double upperCtrlLimit)
          Deprecated.  
static VDouble newVDouble(java.lang.Double value, Alarm alarm, Time time, Display display)
          Creates a new VDouble.
static VDouble newVDouble(double value, Display display)
          Deprecated.  
static VDouble newVDouble(java.lang.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(java.lang.Double value, Time time)
          Creates a new VDouble, no alarm, no display.
static VDouble newVDouble(java.lang.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 VDouble newVDouble(double value, TimeStamp timeStamp, Display display)
          Deprecated.  
static VDoubleArray newVDoubleArray(double[] values, Alarm alarm, Time time, Display display)
          Creates a new VDoubleArray.
static VDoubleArray newVDoubleArray(double[] values, Display display)
          Creates a new VDoubleArray.
static VDoubleArray newVDoubleArray(double[] values, java.util.List<java.lang.Integer> sizes, AlarmSeverity alarmSeverity, AlarmStatus alarmStatus, TimeStamp timeStamp, java.lang.Integer timeUserTag, java.lang.Double lowerDisplayLimit, java.lang.Double lowerAlarmLimit, java.lang.Double lowerWarningLimit, java.lang.String units, java.text.NumberFormat numberFormat, java.lang.Double upperWarningLimit, java.lang.Double upperAlarmLimit, java.lang.Double upperDisplayLimit, java.lang.Double lowerCtrlLimit, java.lang.Double upperCtrlLimit)
          Deprecated.  
static VDoubleArray newVDoubleArray(double[] values, java.util.List<java.lang.Integer> sizes, Alarm alarm, Time time, Display display)
          Creates a new VDoubleArray.
static VDoubleArray newVDoubleArray(ListDouble data, Alarm alarm, Time time, Display display)
          Creates a new VDoubleArray.
static VImage newVImage(int height, int width, byte[] data)
           
static VInt newVInt(java.lang.Integer value, AlarmSeverity alarmSeverity, AlarmStatus alarmStatus, TimeStamp timeStamp, java.lang.Integer timeUserTag, java.lang.Double lowerDisplayLimit, java.lang.Double lowerAlarmLimit, java.lang.Double lowerWarningLimit, java.lang.String units, java.text.NumberFormat numberFormat, java.lang.Double upperWarningLimit, java.lang.Double upperAlarmLimit, java.lang.Double upperDisplayLimit, java.lang.Double lowerCtrlLimit, java.lang.Double upperCtrlLimit)
          Deprecated.  
static VInt newVInt(java.lang.Integer value, Alarm alarm, Time time, Display display)
          Creates a new VInt.
static VIntArray newVIntArray(int[] values, Alarm alarm, Time time, Display display)
           
static VIntArray newVIntArray(int[] values, Display display)
           
static VIntArray newVIntArray(int[] values, java.util.List<java.lang.Integer> sizes, Alarm alarm, Time time, Display display)
           
static VIntArray newVIntArray(ListInt values, Alarm alarm, Time time, Display display)
           
static VMultiDouble newVMultiDouble(java.util.List<VDouble> values, AlarmSeverity alarmSeverity, AlarmStatus alarmStatus, TimeStamp timeStamp, java.lang.Integer timeUserTag, java.lang.Double lowerDisplayLimit, java.lang.Double lowerCtrlLimit, java.lang.Double lowerAlarmLimit, java.lang.Double lowerWarningLimit, java.lang.String units, java.text.NumberFormat format, java.lang.Double upperWarningLimit, java.lang.Double upperAlarmLimit, java.lang.Double upperCtrlLimit, java.lang.Double upperDisplayLimit)
          Deprecated.  
static VMultiDouble newVMultiDouble(java.util.List<VDouble> values, Alarm alarm, Time time, Display display)
          Creates a new VMultiDouble.
static VStatistics newVStatistics(double average, double stdDev, double min, double max, int nSamples, AlarmSeverity alarmSeverity, AlarmStatus alarmStatus, TimeStamp timeStamp, java.lang.Integer timeUserTag, java.lang.Double lowerDisplayLimit, java.lang.Double lowerAlarmLimit, java.lang.Double lowerWarningLimit, java.lang.String units, java.text.NumberFormat numberFormat, java.lang.Double upperWarningLimit, java.lang.Double upperAlarmLimit, java.lang.Double upperDisplayLimit, java.lang.Double lowerCtrlLimit, java.lang.Double upperCtrlLimit)
          Deprecated.  
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(java.lang.String value, AlarmSeverity alarmSeverity, AlarmStatus alarmStatus, TimeStamp timeStamp, java.lang.Integer timeUserTag)
          Deprecated.  
static VString newVString(java.lang.String value, Alarm alarm, Time time)
          Creates a new VString.
static Time timeNow()
          New time with the current timestamp, no user tag and valid data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueFactory

public ValueFactory()
Method Detail

newVString

@Deprecated
public static VString newVString(java.lang.String value,
                                            AlarmSeverity alarmSeverity,
                                            AlarmStatus alarmStatus,
                                            TimeStamp timeStamp,
                                            java.lang.Integer timeUserTag)
Deprecated. 

Parameters:
value -
alarmSeverity -
alarmStatus -
timeStamp -
timeUserTag -
Returns:
the new value

newVString

public static VString newVString(java.lang.String value,
                                 Alarm alarm,
                                 Time time)
Creates a new VString.

Parameters:
value - the string value
alarm - the alarm
time - the time
Returns:
the new value

newVMultiDouble

@Deprecated
public static VMultiDouble newVMultiDouble(java.util.List<VDouble> values,
                                                      AlarmSeverity alarmSeverity,
                                                      AlarmStatus alarmStatus,
                                                      TimeStamp timeStamp,
                                                      java.lang.Integer timeUserTag,
                                                      java.lang.Double lowerDisplayLimit,
                                                      java.lang.Double lowerCtrlLimit,
                                                      java.lang.Double lowerAlarmLimit,
                                                      java.lang.Double lowerWarningLimit,
                                                      java.lang.String units,
                                                      java.text.NumberFormat format,
                                                      java.lang.Double upperWarningLimit,
                                                      java.lang.Double upperAlarmLimit,
                                                      java.lang.Double upperCtrlLimit,
                                                      java.lang.Double upperDisplayLimit)
Deprecated. 

Parameters:
values -
alarmSeverity -
alarmStatus -
timeStamp -
timeUserTag -
lowerDisplayLimit -
lowerCtrlLimit -
lowerAlarmLimit -
lowerWarningLimit -
units -
format -
upperWarningLimit -
upperAlarmLimit -
upperCtrlLimit -
upperDisplayLimit -
Returns:
the new value

newVMultiDouble

public static VMultiDouble newVMultiDouble(java.util.List<VDouble> values,
                                           Alarm alarm,
                                           Time time,
                                           Display display)
Creates a new VMultiDouble.

Parameters:
values - the values
alarm - the alarm
time - the time
display - the display
Returns:
the new value

newVInt

@Deprecated
public static VInt newVInt(java.lang.Integer value,
                                      AlarmSeverity alarmSeverity,
                                      AlarmStatus alarmStatus,
                                      TimeStamp timeStamp,
                                      java.lang.Integer timeUserTag,
                                      java.lang.Double lowerDisplayLimit,
                                      java.lang.Double lowerAlarmLimit,
                                      java.lang.Double lowerWarningLimit,
                                      java.lang.String units,
                                      java.text.NumberFormat numberFormat,
                                      java.lang.Double upperWarningLimit,
                                      java.lang.Double upperAlarmLimit,
                                      java.lang.Double upperDisplayLimit,
                                      java.lang.Double lowerCtrlLimit,
                                      java.lang.Double upperCtrlLimit)
Deprecated. 

Creates new immutable VInt.

Parameters:
value -
alarmSeverity -
alarmStatus -
timeStamp -
timeUserTag -
lowerDisplayLimit -
lowerAlarmLimit -
lowerWarningLimit -
units -
numberFormat -
upperWarningLimit -
upperAlarmLimit -
upperDisplayLimit -
lowerCtrlLimit -
upperCtrlLimit -
Returns:
the new value

newVInt

public static VInt newVInt(java.lang.Integer value,
                           Alarm alarm,
                           Time time,
                           Display display)
Creates a new VInt.

Parameters:
value - the value
alarm - the alarm
time - the time
display - the display
Returns:
the new value

newAlarm

public static Alarm newAlarm(AlarmSeverity alarmSeverity,
                             AlarmStatus alarmStatus)
New alarm with the given severity and status.

Parameters:
alarmSeverity - the alarm severity
alarmStatus - the alarm status
Returns:
the new alarm

alarmNone

public static Alarm alarmNone()
No alarm.

Returns:
severity and status NONE

newAlarm

public static Alarm newAlarm(java.lang.Number value,
                             Display display)
Alarm based on the value and the display ranges.

Parameters:
value - the value
display - the display information
Returns:
the new alarm

newTime

public static Time newTime(Timestamp timestamp,
                           java.lang.Integer timeUserTag,
                           boolean timeValid)
Creates a new time.

Parameters:
timestamp - the timestamp
timeUserTag - the user tag
timeValid - whether the time is valid
Returns:
the new time

newTime

public static Time newTime(Timestamp timestamp)
New time, with no user tag and valid data.

Parameters:
timestamp - the timestamp
Returns:
the new time

timeNow

public static Time timeNow()
New time with the current timestamp, no user tag and valid data.

Returns:
the new time

newDisplay

public static Display newDisplay(java.lang.Double lowerDisplayLimit,
                                 java.lang.Double lowerAlarmLimit,
                                 java.lang.Double lowerWarningLimit,
                                 java.lang.String units,
                                 java.text.NumberFormat numberFormat,
                                 java.lang.Double upperWarningLimit,
                                 java.lang.Double upperAlarmLimit,
                                 java.lang.Double upperDisplayLimit,
                                 java.lang.Double lowerCtrlLimit,
                                 java.lang.Double upperCtrlLimit)
Creates a new display

Parameters:
lowerDisplayLimit - lower display limit
lowerAlarmLimit - lower alarm limit
lowerWarningLimit - lower warning limit
units - the units
numberFormat - the formatter
upperWarningLimit - the upper warning limit
upperAlarmLimit - the upper alarm limit
upperDisplayLimit - the upper display limit
lowerCtrlLimit - the lower control limit
upperCtrlLimit - the upper control limit
Returns:
the new display

displayNone

public static Display displayNone()
Empty display information.

Returns:
no display

newVDouble

public static VDouble newVDouble(java.lang.Double value,
                                 Alarm alarm,
                                 Time time,
                                 Display display)
Creates a new VDouble.

Parameters:
value - the value
alarm - the alarm
time - the time
display - the display
Returns:
the new value

newVDouble

@Deprecated
public static VDouble newVDouble(java.lang.Double value,
                                            AlarmSeverity alarmSeverity,
                                            AlarmStatus alarmStatus,
                                            TimeStamp timeStamp,
                                            java.lang.Integer timeUserTag,
                                            java.lang.Double lowerDisplayLimit,
                                            java.lang.Double lowerAlarmLimit,
                                            java.lang.Double lowerWarningLimit,
                                            java.lang.String units,
                                            java.text.NumberFormat numberFormat,
                                            java.lang.Double upperWarningLimit,
                                            java.lang.Double upperAlarmLimit,
                                            java.lang.Double upperDisplayLimit,
                                            java.lang.Double lowerCtrlLimit,
                                            java.lang.Double upperCtrlLimit)
Deprecated. 

Parameters:
value -
alarmSeverity -
alarmStatus -
timeStamp -
timeUserTag -
lowerDisplayLimit -
lowerAlarmLimit -
lowerWarningLimit -
units -
numberFormat -
upperWarningLimit -
upperAlarmLimit -
upperDisplayLimit -
lowerCtrlLimit -
upperCtrlLimit -
Returns:
the new value

newVDouble

@Deprecated
public static VDouble newVDouble(java.lang.Double value,
                                            AlarmSeverity alarmSeverity,
                                            AlarmStatus alarmStatus,
                                            java.lang.Integer timeUserTag,
                                            TimeStamp timeStamp,
                                            Display display)
Deprecated. 

Parameters:
value -
alarmSeverity -
alarmStatus -
timeUserTag -
timeStamp -
display -
Returns:
the new value

newVDouble

@Deprecated
public static VDouble newVDouble(double value,
                                            TimeStamp timeStamp,
                                            Display display)
Deprecated. 

Creates new immutable VDouble by using the metadata from the old value, and computing the alarm from the metadata range.

Parameters:
value - new numeric value
timeStamp - time stamp
display - metadata
Returns:
new value

newVDouble

public static VDouble newVDouble(java.lang.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.

Parameters:
value - the new value
time - the time
display - the display information
Returns:
the new value

newVDouble

@Deprecated
public static VDouble newVDouble(double value,
                                            Display display)
Deprecated. 

Creates new immutable VDouble by using metadata from the old value, now as timestamp and computing alarm from the metadata range.

Parameters:
value - new numeric value
display - metadata
Returns:
new value

newVDouble

public static VDouble newVDouble(java.lang.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.

Parameters:
value - new numeric value
display - metadata
Returns:
new value

newVDouble

public static VDouble newVDouble(java.lang.Double value)
Creates a new VDouble, no alarm, time now, no display.

Parameters:
value - the value
Returns:
the new value

newVDouble

public static VDouble newVDouble(java.lang.Double value,
                                 Time time)
Creates a new VDouble, no alarm, no display.

Parameters:
value - the value
time - the time
Returns:
the new value

newVStatistics

@Deprecated
public static VStatistics newVStatistics(double average,
                                                    double stdDev,
                                                    double min,
                                                    double max,
                                                    int nSamples,
                                                    AlarmSeverity alarmSeverity,
                                                    AlarmStatus alarmStatus,
                                                    TimeStamp timeStamp,
                                                    java.lang.Integer timeUserTag,
                                                    java.lang.Double lowerDisplayLimit,
                                                    java.lang.Double lowerAlarmLimit,
                                                    java.lang.Double lowerWarningLimit,
                                                    java.lang.String units,
                                                    java.text.NumberFormat numberFormat,
                                                    java.lang.Double upperWarningLimit,
                                                    java.lang.Double upperAlarmLimit,
                                                    java.lang.Double upperDisplayLimit,
                                                    java.lang.Double lowerCtrlLimit,
                                                    java.lang.Double upperCtrlLimit)
Deprecated. 

Creates a new immutable VStatistics.

Parameters:
average -
stdDev -
min -
max -
nSamples -
alarmSeverity -
alarmStatus -
timeStamp -
timeUserTag -
lowerDisplayLimit -
lowerAlarmLimit -
lowerWarningLimit -
units -
numberFormat -
upperWarningLimit -
upperAlarmLimit -
upperDisplayLimit -
lowerCtrlLimit -
upperCtrlLimit -
Returns:
the new value

newVStatistics

public static VStatistics newVStatistics(double average,
                                         double stdDev,
                                         double min,
                                         double max,
                                         int nSamples,
                                         Alarm alarm,
                                         Time time,
                                         Display display)
Creates a new VStatistics.

Parameters:
average - average
stdDev - standard deviation
min - minimum
max - maximum
nSamples - number of samples
alarm - the alarm
time - the time
display - the display
Returns:
the new value

newEInt

@Deprecated
public static VInt newEInt(java.lang.Integer value,
                                      AlarmSeverity alarmSeverity,
                                      AlarmStatus alarmStatus,
                                      TimeStamp timeStamp,
                                      java.lang.Integer timeUserTag,
                                      java.lang.Double lowerDisplayLimit,
                                      java.lang.Double lowerAlarmLimit,
                                      java.lang.Double lowerWarningLimit,
                                      java.lang.String units,
                                      java.text.NumberFormat numberFormat,
                                      java.lang.Double upperWarningLimit,
                                      java.lang.Double upperAlarmLimit,
                                      java.lang.Double upperDisplayLimit,
                                      java.lang.Double lowerCtrlLimit,
                                      java.lang.Double upperCtrlLimit)
Deprecated. use newVInt(java.lang.Integer, org.epics.pvmanager.data.Alarm, org.epics.pvmanager.data.Time, org.epics.pvmanager.data.Display).

Parameters:
value -
alarmSeverity -
alarmStatus -
timeStamp -
timeUserTag -
lowerDisplayLimit -
lowerAlarmLimit -
lowerWarningLimit -
units -
numberFormat -
upperWarningLimit -
upperAlarmLimit -
upperDisplayLimit -
lowerCtrlLimit -
upperCtrlLimit -
Returns:
the new value

newEInt

@Deprecated
public static VInt newEInt(java.lang.Integer value,
                                      AlarmSeverity alarmSeverity,
                                      AlarmStatus alarmStatus,
                                      java.lang.Integer timeUserTag,
                                      TimeStamp timeStamp,
                                      VInt oldValue)
Deprecated. use newVInt(java.lang.Integer, org.epics.pvmanager.data.Alarm, org.epics.pvmanager.data.Time, org.epics.pvmanager.data.Display).

Parameters:
value -
alarmSeverity -
alarmStatus -
timeUserTag -
timeStamp -
oldValue -
Returns:
the new value

newVDoubleArray

public static VDoubleArray newVDoubleArray(double[] values,
                                           java.util.List<java.lang.Integer> sizes,
                                           Alarm alarm,
                                           Time time,
                                           Display display)
Creates a new VDoubleArray.

Parameters:
values - array values
sizes - sizes
alarm - the alarm
time - the time
display - the display
Returns:
the new value

newVDoubleArray

public static VDoubleArray newVDoubleArray(double[] values,
                                           Alarm alarm,
                                           Time time,
                                           Display display)
Creates a new VDoubleArray.

Parameters:
values - array values
alarm - the alarm
time - the time
display - the display
Returns:
the new value

newVDoubleArray

public static VDoubleArray newVDoubleArray(ListDouble data,
                                           Alarm alarm,
                                           Time time,
                                           Display display)
Creates a new VDoubleArray.

Parameters:
data - array data
alarm - the alarm
time - the time
display - the display
Returns:
the new value

newVDoubleArray

public static VDoubleArray newVDoubleArray(double[] values,
                                           Display display)
Creates a new VDoubleArray.

Parameters:
values - array values
display - the display
Returns:
the new value

newVDoubleArray

@Deprecated
public static VDoubleArray newVDoubleArray(double[] values,
                                                      java.util.List<java.lang.Integer> sizes,
                                                      AlarmSeverity alarmSeverity,
                                                      AlarmStatus alarmStatus,
                                                      TimeStamp timeStamp,
                                                      java.lang.Integer timeUserTag,
                                                      java.lang.Double lowerDisplayLimit,
                                                      java.lang.Double lowerAlarmLimit,
                                                      java.lang.Double lowerWarningLimit,
                                                      java.lang.String units,
                                                      java.text.NumberFormat numberFormat,
                                                      java.lang.Double upperWarningLimit,
                                                      java.lang.Double upperAlarmLimit,
                                                      java.lang.Double upperDisplayLimit,
                                                      java.lang.Double lowerCtrlLimit,
                                                      java.lang.Double upperCtrlLimit)
Deprecated. 

Parameters:
values -
sizes -
alarmSeverity -
alarmStatus -
timeStamp -
timeUserTag -
lowerDisplayLimit -
lowerAlarmLimit -
lowerWarningLimit -
units -
numberFormat -
upperWarningLimit -
upperAlarmLimit -
upperDisplayLimit -
lowerCtrlLimit -
upperCtrlLimit -
Returns:
the new value

newVImage

public static VImage newVImage(int height,
                               int width,
                               byte[] data)

newVIntArray

public static VIntArray newVIntArray(int[] values,
                                     java.util.List<java.lang.Integer> sizes,
                                     Alarm alarm,
                                     Time time,
                                     Display display)

newVIntArray

public static VIntArray newVIntArray(int[] values,
                                     Alarm alarm,
                                     Time time,
                                     Display display)

newVIntArray

public static VIntArray newVIntArray(ListInt values,
                                     Alarm alarm,
                                     Time time,
                                     Display display)

newVIntArray

public static VIntArray newVIntArray(int[] values,
                                     Display display)