sdr 0.7

net.cscott.sdr.calls
Class ExprFunc<T>

java.lang.Object
  extended by net.cscott.sdr.calls.ExprFunc<T>
Direct Known Subclasses:
Call, Matcher, Predicate

public abstract class ExprFunc<T>
extends Object

An ExprFunc is responsible for evaluating the value of an Expr. There are a list of ExprFuncs in ExprList.


Nested Class Summary
static class ExprFunc.EvaluationException
          Thrown to indicate an unexpected problem evaluating an Expr, for example a type mismatch.
 
Constructor Summary
ExprFunc()
           
 
Method Summary
abstract  T evaluate(Class<? super T> type, DanceState ds, List<Expr> args)
          Perform the operation of the ExprFunc on the given list of arguments args, yielding a value of the specified type.
abstract  String getName()
          The atom of Exprs which this ExprFunc should be used to evaluate.
 boolean isConstant(Class<? super T> type, List<Expr> args)
          Indicates whether the result of the evaluation would be a constant (ie, independent of DanceState).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExprFunc

public ExprFunc()
Method Detail

getName

public abstract String getName()
The atom of Exprs which this ExprFunc should be used to evaluate.


evaluate

public abstract T evaluate(Class<? super T> type,
                           DanceState ds,
                           List<Expr> args)
                    throws ExprFunc.EvaluationException
Perform the operation of the ExprFunc on the given list of arguments args, yielding a value of the specified type. The DanceState ds is used as context for the evaluation.

Throws:
ExprFunc.EvaluationException - on type mismatch or other unexpected conditions.

isConstant

public boolean isConstant(Class<? super T> type,
                          List<Expr> args)
Indicates whether the result of the evaluation would be a constant (ie, independent of DanceState).


sdr 0.7

Copyright © 2006-2009 C. Scott Ananian