org.epics.pvmanager
Class ExpressionLanguage

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

public class ExpressionLanguage
extends java.lang.Object

Operators to constructs expression of PVs that the PVManager will be able to monitor.

Author:
carcassi

Nested Class Summary
static class ExpressionLanguage.Filter<T>
          Filters a data stream, removing updates that match the given function.
static interface ExpressionLanguage.OneArgFunction<R,A>
          A user provided single argument function.
static interface ExpressionLanguage.TwoArgFunction<R,A1,A2>
          A user provided double argument function.
 
Method Summary
static SourceRateExpression<java.lang.Object> channel(java.lang.String name)
          A channel with the given name of any type.
static
<T> DesiredRateExpression<java.util.List<T>>
filterBy(ExpressionLanguage.Filter<?> filter, DesiredRateExpression<java.util.List<T>> expression)
          Filters a stream of updates with the given filter.
static
<T> DesiredRateExpression<T>
latestValueOf(SourceRateExpression<T> expression)
          Expression that returns (only) at the desired rate the latest value computed from a SourceRateExpression.
static
<T> DesiredRateExpression<java.util.List<T>>
newValuesOf(SourceRateExpression<T> expression)
          Returns all the new values generated by the expression source rate.
static
<R,A> DesiredRateExpression<R>
resultOf(ExpressionLanguage.OneArgFunction<R,A> function, DesiredRateExpression<A> argExpression)
          An expression that represents the result of a user provided function.
static
<R,A1,A2> DesiredRateExpression<R>
resultOf(ExpressionLanguage.TwoArgFunction<R,A1,A2> function, DesiredRateExpression<A1> arg1Expression, DesiredRateExpression<A2> arg2Expression)
          An expression that represents the result of a user provided function.
static
<T> DesiredRateExpression<java.util.List<T>>
timedCacheOf(SourceRateExpression<T> expression, TimeDuration maxIntervalBetweenSamples)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

channel

public static SourceRateExpression<java.lang.Object> channel(java.lang.String name)
A channel with the given name of any type.

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

newValuesOf

public static <T> DesiredRateExpression<java.util.List<T>> newValuesOf(SourceRateExpression<T> expression)
Returns all the new values generated by the expression source rate.

Type Parameters:
T - type read
Parameters:
expression - source rate expression
Returns:
a new expression

timedCacheOf

public static <T> DesiredRateExpression<java.util.List<T>> timedCacheOf(SourceRateExpression<T> expression,
                                                                        TimeDuration maxIntervalBetweenSamples)

latestValueOf

public static <T> DesiredRateExpression<T> latestValueOf(SourceRateExpression<T> expression)
Expression that returns (only) at the desired rate the latest value computed from a SourceRateExpression.

Type Parameters:
T - result type
Parameters:
expression - expression read at the source rate
Returns:
a new expression

resultOf

public static <R,A> DesiredRateExpression<R> resultOf(ExpressionLanguage.OneArgFunction<R,A> function,
                                                      DesiredRateExpression<A> argExpression)
An expression that represents the result of a user provided function.

Type Parameters:
R - result type
A - argument type
Parameters:
function - the user provided function
argExpression - expression for the function argument
Returns:
a new expression

resultOf

public static <R,A1,A2> DesiredRateExpression<R> resultOf(ExpressionLanguage.TwoArgFunction<R,A1,A2> function,
                                                          DesiredRateExpression<A1> arg1Expression,
                                                          DesiredRateExpression<A2> arg2Expression)
An expression that represents the result of a user provided function.

Type Parameters:
R - result type
A1 - first argument type
A2 - second argument type
Parameters:
function - the user provided function
arg1Expression - expression for the first argument
arg2Expression - expression for the second argument
Returns:
a new expression

filterBy

public static <T> DesiredRateExpression<java.util.List<T>> filterBy(ExpressionLanguage.Filter<?> filter,
                                                                    DesiredRateExpression<java.util.List<T>> expression)
Filters a stream of updates with the given filter.

Type Parameters:
T - the type of data streaming in and out
Parameters:
filter - the filtering function
expression - the argument expression
Returns:
a new expression for the filtering result


Copyright © 2011. All Rights Reserved.