com.voytechs.jnetstream.npl
Class AssignOpNode

java.lang.Object
  extended by com.voytechs.jnetstream.npl.Node
      extended by com.voytechs.jnetstream.npl.OpNode
          extended by com.voytechs.jnetstream.npl.AssignOpNode
All Implemented Interfaces:
BooleanNode, IntNode, LongNode, StringNode, Visitable
Direct Known Subclasses:
AssignMinusOpNode, AssignPlusOpNode

public class AssignOpNode
extends OpNode
implements LongNode, BooleanNode, StringNode


Field Summary
 
Fields inherited from class com.voytechs.jnetstream.npl.OpNode
BINARY, cardinality, FLAG_NO_OP, flags, HIGH, left, LOW, MEDIUM, NORMAL, op, presedence, right, UNARY
 
Fields inherited from class com.voytechs.jnetstream.npl.Node
parent, token
 
Constructor Summary
  AssignOpNode()
           
  AssignOpNode(LongNode right, MutableLongNode left)
           
protected AssignOpNode(java.lang.String opString, int presedence)
           
protected AssignOpNode(java.lang.String opString, int presedence, LongNode right, MutableLongNode left)
           
 
Method Summary
 OpNode createOpNode(Node right, Node left)
          Creates a new instace of this node type.
 OpNode createOpNode(java.util.Stack operands)
          Creates a new node using the factory pattern.
 void doAssignment()
           
 boolean getBoolean()
           
 int getInt()
           
 long getLong()
           
 java.lang.String getString()
           
static void main(java.lang.String[] args)
          Test function for AssignOpNode
 
Methods inherited from class com.voytechs.jnetstream.npl.OpNode
canOptimize, clone, createOpNode, equals, getCardinality, getFlags, getLeft, getOpString, getPresedence, getRight, optimize, set, setFlag, setLeft, setRight, toString, visit
 
Methods inherited from class com.voytechs.jnetstream.npl.Node
getParent, getToken, setParent, setToken
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssignOpNode

protected AssignOpNode(java.lang.String opString,
                       int presedence,
                       LongNode right,
                       MutableLongNode left)
Parameters:
-
Throws:

AssignOpNode

protected AssignOpNode(java.lang.String opString,
                       int presedence)

AssignOpNode

public AssignOpNode(LongNode right,
                    MutableLongNode left)
Parameters:
-
Throws:

AssignOpNode

public AssignOpNode()
Method Detail

getString

public java.lang.String getString()
Specified by:
getString in interface StringNode

getBoolean

public boolean getBoolean()
Specified by:
getBoolean in interface BooleanNode

getInt

public int getInt()
Specified by:
getInt in interface IntNode

getLong

public long getLong()
Specified by:
getLong in interface LongNode

doAssignment

public void doAssignment()

createOpNode

public OpNode createOpNode(Node right,
                           Node left)
Creates a new instace of this node type.

Overrides:
createOpNode in class OpNode

createOpNode

public OpNode createOpNode(java.util.Stack operands)
                    throws OperandException,
                           ExpInternalException
Creates a new node using the factory pattern. New node is initialized using the operands from the stack. OP node is either unary or binary operand node (takes 1 or 2 elements from the stack). This depends on the value of cardinality (see getCardinatlity()).

Overrides:
createOpNode in class OpNode
Parameters:
operands - Stack containing operands.
Returns:
Newly created OpNode initialized.
Throws:
OperandException - Throws OperandException if there aren't enough operands on the stack.
ExpInternalException

main

public static void main(java.lang.String[] args)
Test function for AssignOpNode

Parameters:
args - command line arguments