public final class TimEL extends Object
long now = new Date().getTime(); // Assemble the evaluation interval as [now, now + 1 second) Interval interval = Interval.of(now, now + 1000L); // Compile the expression 1 + 1 Expression<Double> expression = TimEL .getCompiler("1 + 1") .compileExpression(Types.getNumericDoubleType()); // Iterate through the results TimeIterator<Double> itor = TimEL .getExecutor(expression) .evaluateFor(interval); // Since 1+1 is constant we'll have a single sample for the whole interval double v = itor.next().getValue();
Modifier and Type | Method | Description |
---|---|---|
static <V> TimeIterator<V> |
evaluate(Expression<V> expression,
Interval interval) |
Evaluate a compiled expression.
|
static CompilerBuilder |
parse(String source) |
Initiates the compilation of the given source.
|
public static CompilerBuilder parse(String source)
source
- Source to parsepublic static <V> TimeIterator<V> evaluate(Expression<V> expression, Interval interval)
V
- Value Java typeexpression
- The expression to evaluateinterval
- Evaluation intervalCopyright © 2019. All rights reserved.