issrg.pba.rbac
Class TimeInterpreter
java.lang.Object
issrg.pba.rbac.TimeInterpreter
- All Implemented Interfaces:
- Interpreter
public class TimeInterpreter
- extends java.lang.Object
- implements Interpreter
This class interprets comparisons of Time values in IF-statements.
Field Summary |
protected static java.util.logging.Logger |
log
|
Method Summary |
java.lang.String |
canEvaluate(Term[] t)
This method tells if the Terms can be evaluated by this interpreter. |
java.lang.Object |
evaluate(Environment env,
Term[] t)
This method evaluates the expression specified by an array of Terms,
given the Environment. |
static void |
register()
This method registers as an interpreter for specific comparison
operators. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static final java.util.logging.Logger log
TimeInterpreter
protected TimeInterpreter(int mode)
register
public static void register()
- This method registers as an interpreter for specific comparison
operators.
canEvaluate
public java.lang.String canEvaluate(Term[] t)
- This method tells if the Terms can be evaluated by this interpreter.
- Specified by:
canEvaluate
in interface Interpreter
- Parameters:
t
- - the array of Terms to evaluate
- Returns:
- Types.BOOLEAN_TYPE, if the array of Terms contains only two
elements, and both are of type Time.TIME_TYPE; otherwise returns
null, i.e. can't evaluate
evaluate
public java.lang.Object evaluate(Environment env,
Term[] t)
throws EvaluationException
- This method evaluates the expression specified by an array of Terms,
given the Environment.
- Specified by:
evaluate
in interface Interpreter
- Parameters:
env
- - the Environment of evaluationt
- - the array of Terms, each containing the actual value;
it must contain only 2 elements, both of type Time.TIME_TYPE
- Returns:
- Boolean, the value of which tells whether the result is
true or false
- Throws:
EvaluationException,
- if the expression cannot be evaluated
EvaluationException