Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.tripi.asp
Class ArithmeticNode  view ArithmeticNode download ArithmeticNode.java

java.lang.Object
  extended bycom.tripi.asp.ArithmeticNode
All Implemented Interfaces:
Node

public class ArithmeticNode
extends java.lang.Object
implements Node

ArithmenticNode handles arithmetic operations. Status of implementation:

Version:
0.9

Field Summary
static int AND
          Logical and operator
static int CONCAT
          The string concatenation operator.
private  org.apache.log4j.Category DBG
          Debugging class
static int DIV
          The division operator.
static int EQ
          The equal operator.
static int EQV
          Logical equivalence operator
static int EXP
          Exponent (power) operator
static int GE
          Greater than or equal operator
static int GT
          The greater than operator.
static int IMP
          Logical implication operator
static int INTDIV
          The integer division operator.
static int IS
          Object equivilence
static int LE
          Less than or equal operator
(package private)  java.lang.Object left
          Left side of expression
static int LT
          Less than operator
static int MINUS
          The minus operator.
static int MOD
          Modulus operator
static int MULT
          The multiplicative operator.
static int NE
          Not equal operator
static int NOT
          Logical not operator
static int OR
          Logical or operator
static int PLUS
          The plus operator.
(package private)  java.lang.Object right
          Right side of expression
(package private)  int type
          Type of expression
static int XOR
          Logical exclusive or operator
 
Constructor Summary
ArithmeticNode(java.lang.Object left, java.lang.Object right, int type)
          Constructor for creating a new arithmetic node.
 
Method Summary
protected  int compare(java.lang.Object aObj, java.lang.Object bObj)
          Internal procedure used to compare any two expressions.
private static AspDate doDateAdd(AspDate aDate, AspDate bDate)
          This function performs an add function with two dates.
private  java.lang.Object doLogicalAnd(java.lang.Object avalObj, java.lang.Object bvalObj)
          Internal function to perform a logical AND operation.
private  java.lang.Object doLogicalOr(java.lang.Object avalObj, java.lang.Object bvalObj)
          Internal function to perform a logical OR operation.
private  java.lang.Object doLogicalXor(java.lang.Object avalObj, java.lang.Object bvalObj)
          Internal function to perform a logical XOR operation.
private  java.lang.Object doNumericAnd(java.lang.Object avalObj, java.lang.Object bvalObj)
          Internal function to perform a numeric AND operation.
private  java.lang.Object doNumericOr(java.lang.Object avalObj, java.lang.Object bvalObj)
          Internal function to perform a numeric OR operation.
private  java.lang.Object doNumericXor(java.lang.Object avalObj, java.lang.Object bvalObj)
          Internal function to perform a numeric XOR operation.
 void dump()
          Dumps this node to standard out.
 java.lang.Object execute(AspContext context)
          Dumps this node to standard out.
 java.lang.Object getLeft()
          Gets the left hand side.
 java.lang.Object getRight()
          Gets the right hand side.
 int getType()
          Gets this operation type.
 void prepare(AspContext context)
          Prepares this node for execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DBG

private org.apache.log4j.Category DBG
Debugging class


PLUS

public static final int PLUS
The plus operator.

See Also:
Constant Field Values

MINUS

public static final int MINUS
The minus operator.

See Also:
Constant Field Values

MULT

public static final int MULT
The multiplicative operator.

See Also:
Constant Field Values

DIV

public static final int DIV
The division operator.

See Also:
Constant Field Values

INTDIV

public static final int INTDIV
The integer division operator.

See Also:
Constant Field Values

CONCAT

public static final int CONCAT
The string concatenation operator.

See Also:
Constant Field Values

EQ

public static final int EQ
The equal operator.

See Also:
Constant Field Values

GT

public static final int GT
The greater than operator.

See Also:
Constant Field Values

LT

public static final int LT
Less than operator

See Also:
Constant Field Values

NE

public static final int NE
Not equal operator

See Also:
Constant Field Values

NOT

public static final int NOT
Logical not operator

See Also:
Constant Field Values

OR

public static final int OR
Logical or operator

See Also:
Constant Field Values

AND

public static final int AND
Logical and operator

See Also:
Constant Field Values

EXP

public static final int EXP
Exponent (power) operator

See Also:
Constant Field Values

EQV

public static final int EQV
Logical equivalence operator

See Also:
Constant Field Values

IMP

public static final int IMP
Logical implication operator

See Also:
Constant Field Values

MOD

public static final int MOD
Modulus operator

See Also:
Constant Field Values

XOR

public static final int XOR
Logical exclusive or operator

See Also:
Constant Field Values

GE

public static final int GE
Greater than or equal operator

See Also:
Constant Field Values

LE

public static final int LE
Less than or equal operator

See Also:
Constant Field Values

IS

public static final int IS
Object equivilence

See Also:
Constant Field Values

left

java.lang.Object left
Left side of expression


right

java.lang.Object right
Right side of expression


type

int type
Type of expression

Constructor Detail

ArithmeticNode

public ArithmeticNode(java.lang.Object left,
                      java.lang.Object right,
                      int type)
Constructor for creating a new arithmetic node.

Method Detail

getType

public int getType()
Gets this operation type.


getLeft

public java.lang.Object getLeft()
Gets the left hand side.


getRight

public java.lang.Object getRight()
Gets the right hand side.


dump

public void dump()
          throws AspException
Dumps this node to standard out.

Specified by:
dump in interface Node

prepare

public void prepare(AspContext context)
             throws AspException
Prepares this node for execution.

Specified by:
prepare in interface Node

execute

public java.lang.Object execute(AspContext context)
                         throws AspException
Dumps this node to standard out.

Specified by:
execute in interface Node

doLogicalAnd

private java.lang.Object doLogicalAnd(java.lang.Object avalObj,
                                      java.lang.Object bvalObj)
                               throws AspException
Internal function to perform a logical AND operation.


doNumericAnd

private java.lang.Object doNumericAnd(java.lang.Object avalObj,
                                      java.lang.Object bvalObj)
                               throws AspException
Internal function to perform a numeric AND operation.


doLogicalOr

private java.lang.Object doLogicalOr(java.lang.Object avalObj,
                                     java.lang.Object bvalObj)
                              throws AspException
Internal function to perform a logical OR operation.


doNumericOr

private java.lang.Object doNumericOr(java.lang.Object avalObj,
                                     java.lang.Object bvalObj)
                              throws AspException
Internal function to perform a numeric OR operation.


doLogicalXor

private java.lang.Object doLogicalXor(java.lang.Object avalObj,
                                      java.lang.Object bvalObj)
                               throws AspException
Internal function to perform a logical XOR operation.


doNumericXor

private java.lang.Object doNumericXor(java.lang.Object avalObj,
                                      java.lang.Object bvalObj)
                               throws AspException
Internal function to perform a numeric XOR operation.


compare

protected int compare(java.lang.Object aObj,
                      java.lang.Object bObj)
               throws AspException
Internal procedure used to compare any two expressions.


doDateAdd

private static AspDate doDateAdd(AspDate aDate,
                                 AspDate bDate)
                          throws AspException
This function performs an add function with two dates.