net.sourceforge.sasi
Class SASIEval

java.lang.Object
  extended bynet.sourceforge.sasi.SASIEval

public class SASIEval
extends java.lang.Object

Provides methods to evalutes an expression to true or false. Each object represents a node in the expression tree The tree is build up by the Parser class/ sasi.cup

Author:
Alexander Merz

Field Summary
static java.lang.String AND
          operator constant for the & operator
static java.lang.String BROWSED
           
static java.lang.String COMPLETED
           
static java.lang.String EQUAL
          operator constant for the = operator
static java.lang.String FAILED
           
static java.lang.String INCOMPLETE
           
static java.lang.String NOT
          operator constant for the ~ operator
static java.lang.String NOTATTEMPTED
           
static java.lang.String NOTEQUAL
          operator constant for the <> operator
static java.lang.String OR
          operator constant for the | operator
static java.lang.String PASSED
           
 
Constructor Summary
SASIEval(SASIEval e1)
          Constructor for a child node
SASIEval(java.lang.String id)
          Constructor for a single identifier aka a 'leaf' in the tree
SASIEval(java.lang.String op, SASIEval e1)
          Constructor for a NOT expression
SASIEval(java.lang.String op, SASIEval e1, SASIEval e2)
          Constructor for an AND/OR expression
SASIEval(java.lang.String op, java.lang.String id, java.lang.String value)
          Constructor for an EQUAL/NOTEQUAL expression
SASIEval(java.lang.String c, java.util.Vector v)
          Constructor for a set (c*{Set})
 
Method Summary
 boolean interpret(java.util.HashMap hm)
          evaluates the expression of this node to true or false
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PASSED

public static java.lang.String PASSED

FAILED

public static java.lang.String FAILED

COMPLETED

public static java.lang.String COMPLETED

INCOMPLETE

public static java.lang.String INCOMPLETE

BROWSED

public static java.lang.String BROWSED

NOTATTEMPTED

public static java.lang.String NOTATTEMPTED

AND

public static java.lang.String AND
operator constant for the & operator


NOT

public static java.lang.String NOT
operator constant for the ~ operator


OR

public static java.lang.String OR
operator constant for the | operator


EQUAL

public static java.lang.String EQUAL
operator constant for the = operator


NOTEQUAL

public static java.lang.String NOTEQUAL
operator constant for the <> operator

Constructor Detail

SASIEval

public SASIEval(java.lang.String id)
Constructor for a single identifier aka a 'leaf' in the tree

Parameters:
id - Identifier

SASIEval

public SASIEval(java.lang.String c,
                java.util.Vector v)
Constructor for a set (c*{Set})

Parameters:
c - the quantifier or null if no quantifier provided
v - the identifiers in the set

SASIEval

public SASIEval(SASIEval e1)
Constructor for a child node

Parameters:
e1 - child node

SASIEval

public SASIEval(java.lang.String op,
                SASIEval e1)
Constructor for a NOT expression

Parameters:
op - operator constant
e1 - child node to evaluate

SASIEval

public SASIEval(java.lang.String op,
                SASIEval e1,
                SASIEval e2)
Constructor for an AND/OR expression

Parameters:
op - operator constant
e1 - left child node to evaluate
e2 - right child node to evaluate

SASIEval

public SASIEval(java.lang.String op,
                java.lang.String id,
                java.lang.String value)
Constructor for an EQUAL/NOTEQUAL expression

Parameters:
op - operator constant
id - Identifier
value - String to compare with
Method Detail

interpret

public boolean interpret(java.util.HashMap hm)
evaluates the expression of this node to true or false

Parameters:
hm - HashMap with the sco states
Returns: