org.epics.pvmanager.data
Class ExpressionLanguage

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

public class ExpressionLanguage
extends java.lang.Object

PVManager expression language support for EPICS types.

Author:
carcassi

Method Summary
static DesiredRateExpression<VDouble> averageOf(SourceRateExpression<VDouble> doublePv)
          Aggregates the sample at the scan rate and takes the average.
static VTableColumn column(java.lang.String name, DesiredRateExpressionList<?> values)
          A column for an aggregated vTable.
static DesiredRateExpression<VStatistics> statisticsOf(SourceRateExpression<VDouble> doublePv)
          Aggregates the sample at the scan rate and calculates statistical information.
static DesiredRateExpressionList<VStatistics> statisticsOf(SourceRateExpressionList<VDouble> doubleExpressions)
          Applies statisticsOf(org.epics.pvmanager.expression.SourceRateExpression) to all arguments.
static DesiredRateExpression<VMultiDouble> synchronizedArrayOf(TimeDuration tolerance, SourceRateExpressionList<VDouble> expressions)
          A synchronized array from the given expression.
static DesiredRateExpression<VMultiDouble> synchronizedArrayOf(TimeDuration tolerance, TimeDuration cacheDepth, SourceRateExpressionList<VDouble> expressions)
          A synchronized array from the given expression.
static ChannelExpression<VByteArray,byte[]> vByteArray(java.lang.String name)
          A channel with the given name of type VByteArray.
static DesiredRateExpression<VDoubleArray> vConst(double... values)
          A constant representing a double array.
static DesiredRateExpression<VDouble> vConst(double value)
          A constant representing a double.
static DesiredRateExpression<VInt> vConst(int value)
          A constant representing an int.
static DesiredRateExpression<VDoubleArray> vConst(ListDouble values)
          A constant representing a double array.
static DesiredRateExpression<VIntArray> vConst(ListInt values)
          A constant representing an int array.
static ChannelExpression<VDouble,java.lang.Double> vDouble(java.lang.String name)
          A channel with the given name of type VDouble.
static ChannelExpression<VDoubleArray,float[]> vDoubleArray(java.lang.String name)
          A channel with the given name of type VDoubleArray.
static DesiredRateExpression<VDoubleArray> vDoubleArrayOf(DesiredRateExpressionList<? extends VNumber> expressions)
          Transforms a list of numeric scalar into a double array.
static SourceRateExpression<VDoubleArray> vDoubleArrayOf(SourceRateExpression<?> expression)
          Deprecated. use vNumberArray(java.lang.String)
static DesiredRateExpressionList<VDouble> vDoubleConstants(java.util.List<java.lang.Double> values)
          A list of constant expressions of type VDouble.
static SourceRateExpression<VDouble> vDoubleOf(SourceRateExpression<?> expression)
          Deprecated. use vNumber(java.lang.String)
static ChannelExpressionList<VDouble,java.lang.Double> vDoubles(java.util.List<java.lang.String> names)
          A list of channels with the given names, all of type VDouble.
static ChannelExpression<VEnum,java.lang.Integer> vEnum(java.lang.String name)
          A channel with the given name of type VEnum.
static ChannelExpression<VFloatArray,float[]> vFloatArray(java.lang.String name)
          A channel with the given name of type VFloatArray.
static ChannelExpression<VInt,java.lang.Integer> vInt(java.lang.String name)
          A channel with the given name of type VInt.
static ChannelExpression<VIntArray,int[]> vIntArray(java.lang.String name)
          A channel with the given name of type VIntArray.
static DesiredRateExpressionList<VInt> vIntConstants(java.util.List<java.lang.Integer> values)
          A list of constant expressions of type VDouble.
static ChannelExpression<VNumber,java.lang.Number> vNumber(java.lang.String name)
          A channel with the given name of type VNumber.
static ChannelExpression<VNumberArray,ListNumber> vNumberArray(java.lang.String name)
          A channel with the given name of type VNumberArray.
static ChannelExpression<VShortArray,short[]> vShortArray(java.lang.String name)
          A channel with the given name of type VShortArray.
static ChannelExpression<VString,java.lang.String> vString(java.lang.String name)
          A channel with the given name of type VString.
static ChannelExpression<VStringArray,java.lang.String[]> vStringArray(java.lang.String name)
          A channel with the given name of type VStringArray.
static DesiredRateExpressionList<VString> vStringConstants(java.util.List<java.lang.String> values)
          A list of constant expressions of type VString.
static DesiredRateExpression<VTable> vTable(VTableColumn... columns)
          Creates a vTable by aggregating different values from different pvs.
static ChannelExpression<VType,java.lang.Object> vType(java.lang.String name)
          A channel with the given name that returns any of the value type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

vDoubleOf

@Deprecated
public static SourceRateExpression<VDouble> vDoubleOf(SourceRateExpression<?> expression)
Deprecated. use vNumber(java.lang.String)

Expects a numeric scalar (VDouble or VInt) and converts it to a VDouble.

Parameters:
expression - an expression that returns a numeric scalar
Returns:
a new expression

vDoubleArrayOf

@Deprecated
public static SourceRateExpression<VDoubleArray> vDoubleArrayOf(SourceRateExpression<?> expression)
Deprecated. use vNumberArray(java.lang.String)

Expects a numeric array (VDoubleArray, VFloatArray, VIntArray, VShortArray or VByteArray) and converts it to a VDoubleArray.

Parameters:
expression - an expression that returns a numeric array
Returns:
a new expression

vDoubleArrayOf

public static DesiredRateExpression<VDoubleArray> vDoubleArrayOf(DesiredRateExpressionList<? extends VNumber> expressions)
Transforms a list of numeric scalar into a double array.

Parameters:
expressions - a list of numeric expressions
Returns:
a new double array expression

vType

public static ChannelExpression<VType,java.lang.Object> vType(java.lang.String name)
A channel with the given name that returns any of the value type.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vNumber

public static ChannelExpression<VNumber,java.lang.Number> vNumber(java.lang.String name)
A channel with the given name of type VNumber.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vDouble

public static ChannelExpression<VDouble,java.lang.Double> vDouble(java.lang.String name)
A channel with the given name of type VDouble.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vInt

public static ChannelExpression<VInt,java.lang.Integer> vInt(java.lang.String name)
A channel with the given name of type VInt.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vNumberArray

public static ChannelExpression<VNumberArray,ListNumber> vNumberArray(java.lang.String name)
A channel with the given name of type VNumberArray.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vFloatArray

public static ChannelExpression<VFloatArray,float[]> vFloatArray(java.lang.String name)
A channel with the given name of type VFloatArray.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vDoubleArray

public static ChannelExpression<VDoubleArray,float[]> vDoubleArray(java.lang.String name)
A channel with the given name of type VDoubleArray.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vByteArray

public static ChannelExpression<VByteArray,byte[]> vByteArray(java.lang.String name)
A channel with the given name of type VByteArray.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vShortArray

public static ChannelExpression<VShortArray,short[]> vShortArray(java.lang.String name)
A channel with the given name of type VShortArray.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vIntArray

public static ChannelExpression<VIntArray,int[]> vIntArray(java.lang.String name)
A channel with the given name of type VIntArray.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vString

public static ChannelExpression<VString,java.lang.String> vString(java.lang.String name)
A channel with the given name of type VString.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vStringArray

public static ChannelExpression<VStringArray,java.lang.String[]> vStringArray(java.lang.String name)
A channel with the given name of type VStringArray.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vEnum

public static ChannelExpression<VEnum,java.lang.Integer> vEnum(java.lang.String name)
A channel with the given name of type VEnum.

Parameters:
name - the channel name; can't be null
Returns:
an expression representing the channel

vDoubles

public static ChannelExpressionList<VDouble,java.lang.Double> vDoubles(java.util.List<java.lang.String> names)
A list of channels with the given names, all of type VDouble.

Parameters:
names - the channel names; can't be null
Returns:
a list of expressions representing the channels

vConst

public static DesiredRateExpression<VDouble> vConst(double value)
A constant representing a double. Alarm will be none, timestamp now and no display information.

Parameters:
value - the constant value
Returns:
a double expression

vConst

public static DesiredRateExpression<VInt> vConst(int value)
A constant representing an int. Alarm will be none, timestamp now and no display information.

Parameters:
value - the constant value
Returns:
an int expression

vConst

public static DesiredRateExpression<VDoubleArray> vConst(double... values)
A constant representing a double array. Alarm will be none, timestamp now and no display information.

Parameters:
values - the constant values
Returns:
a double array expression

vConst

public static DesiredRateExpression<VDoubleArray> vConst(ListDouble values)
A constant representing a double array. Alarm will be none, timestamp now and no display information.

Parameters:
values - the constant values
Returns:
a double array expression

vConst

public static DesiredRateExpression<VIntArray> vConst(ListInt values)
A constant representing an int array. Alarm will be none, timestamp now and no display information.

Parameters:
values - the constant values
Returns:
an int array expression

vDoubleConstants

public static DesiredRateExpressionList<VDouble> vDoubleConstants(java.util.List<java.lang.Double> values)
A list of constant expressions of type VDouble.

Parameters:
values - the list of constants
Returns:
a list of double expression

vIntConstants

public static DesiredRateExpressionList<VInt> vIntConstants(java.util.List<java.lang.Integer> values)
A list of constant expressions of type VDouble.

Parameters:
values - the list of constants
Returns:
a list of int expression

vStringConstants

public static DesiredRateExpressionList<VString> vStringConstants(java.util.List<java.lang.String> values)
A list of constant expressions of type VString.

Parameters:
values - the list of constants
Returns:
a list of string expression

averageOf

public static DesiredRateExpression<VDouble> averageOf(SourceRateExpression<VDouble> doublePv)
Aggregates the sample at the scan rate and takes the average.

Parameters:
doublePv - the expression to take the average of; can't be null
Returns:
an expression representing the average of the expression

statisticsOf

public static DesiredRateExpression<VStatistics> statisticsOf(SourceRateExpression<VDouble> doublePv)
Aggregates the sample at the scan rate and calculates statistical information.

Parameters:
doublePv - the expression to calculate the statistics information on; can't be null
Returns:
an expression representing the statistical information of the expression

statisticsOf

public static DesiredRateExpressionList<VStatistics> statisticsOf(SourceRateExpressionList<VDouble> doubleExpressions)
Applies statisticsOf(org.epics.pvmanager.expression.SourceRateExpression) to all arguments.

Parameters:
doubleExpressions - a list of double expressions
Returns:
a list of statistical expressions

synchronizedArrayOf

public static DesiredRateExpression<VMultiDouble> synchronizedArrayOf(TimeDuration tolerance,
                                                                      SourceRateExpressionList<VDouble> expressions)
A synchronized array from the given expression.

Parameters:
tolerance - maximum time difference between samples
expressions - the expressions from which to reconstruct the array
Returns:
an expression for the array

synchronizedArrayOf

public static DesiredRateExpression<VMultiDouble> synchronizedArrayOf(TimeDuration tolerance,
                                                                      TimeDuration cacheDepth,
                                                                      SourceRateExpressionList<VDouble> expressions)
A synchronized array from the given expression.

Parameters:
tolerance - maximum time difference between samples in the reconstructed array
cacheDepth - maximum time difference between samples in the caches used to reconstruct the array
expressions - the expressions from which to reconstruct the array
Returns:
an expression for the array

column

public static VTableColumn column(java.lang.String name,
                                  DesiredRateExpressionList<?> values)
A column for an aggregated vTable.

Parameters:
name - the name of the column
values - the value of the column
Returns:
the column

vTable

public static DesiredRateExpression<VTable> vTable(VTableColumn... columns)
Creates a vTable by aggregating different values from different pvs.

Parameters:
columns - columns of the table
Returns:
an expression for the table