org.scijava.sjep.eval
Interface Evaluator

All Known Subinterfaces:
StackEvaluator, StandardEvaluator
All Known Implementing Classes:
AbstractEvaluator, AbstractStackEvaluator, AbstractStandardStackEvaluator, DefaultEvaluator

public interface Evaluator

Interface for expression evaluators.

Author:
Curtis Rueden

Method Summary
 Object evaluate(LinkedList<Object> queue)
          Evaluates the given postfix token queue, returning the result.
 Object evaluate(String expression)
          Evaluates the given infix expression, returning the result.
 Object evaluate(SyntaxTree syntaxTree)
          Evaluates the given syntax tree, returning the result.
 Object get(Variable v)
          Gets the value of the given variable.
 void set(Variable v, Object value)
          Sets the value of the given variable.
 void setAll(Map<? extends String,? extends Object> map)
          Assigns variables en masse.
 Object value(Object token)
          Gets the value of the given token.
 

Method Detail

evaluate

Object evaluate(String expression)
Evaluates the given infix expression, returning the result.


evaluate

Object evaluate(LinkedList<Object> queue)
Evaluates the given postfix token queue, returning the result.


evaluate

Object evaluate(SyntaxTree syntaxTree)
Evaluates the given syntax tree, returning the result.


value

Object value(Object token)
Gets the value of the given token. For variables, returns the value of the variable, throwing an exception if the variable is not set. For literals, returns the token itself.


get

Object get(Variable v)
Gets the value of the given variable.


set

void set(Variable v,
         Object value)
Sets the value of the given variable.


setAll

void setAll(Map<? extends String,? extends Object> map)
Assigns variables en masse.



Copyright © 2015 SciJava. All rights reserved.