|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.pba.rbac.xmlpolicy.ifstatement.IntegerInterpreter
public class IntegerInterpreter
This is the interpreter for comparisons of integers in the IF-statements.
Field Summary | |
---|---|
static int |
EQ_MODE
|
static int |
GE_MODE
|
static int |
GT_MODE
|
static int |
LE_MODE
|
static int |
LT_MODE
|
protected int |
mode
|
Constructor Summary | |
---|---|
protected |
IntegerInterpreter()
|
protected |
IntegerInterpreter(int mode)
This is the constructor used to build the interpreter for different types of comparison operation: an interpreter for GE, LE, GT, LT and EQ correspondingly. |
Method Summary | |
---|---|
java.lang.String |
canEvaluate(Term[] t)
This method tells whether this interpreter can evaluate the expression, which is only if there are only two Terms, and both are of type Types.INTEGER_TYPE. |
java.lang.Object |
evaluate(Environment env,
Term[] t)
This method evaluates the comparison expression, depending on the mode it was given at construction time. |
static void |
register()
Call this method to register the IntegerInterpreter with the relevant expression nodes: EqNode, GeNode, GtNode, LeNode, LtNode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int mode
public static final int EQ_MODE
public static final int GE_MODE
public static final int LE_MODE
public static final int GT_MODE
public static final int LT_MODE
Constructor Detail |
---|
protected IntegerInterpreter()
protected IntegerInterpreter(int mode)
mode
- stands for the mode of operation; it can be one of EQ_MODE,
GE_MODE, LE_MODE,
GT_MODE or LT_MODEMethod Detail |
---|
public static void register()
public java.lang.String canEvaluate(Term[] t)
canEvaluate
in interface Interpreter
t
- - the array of Terms to be evaluated
public java.lang.Object evaluate(Environment env, Term[] t) throws EvaluationException
evaluate
in interface Interpreter
env
- - the Environment in which the evaluation occurst
- - the array of Terms to be evaluated; should contain two and only
two Terms, each of type Types.INTEGER_TYPE
EvaluationException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |