com.voytechs.jnetstream.npl
Class PlusOpNode
java.lang.Object
com.voytechs.jnetstream.npl.Node
com.voytechs.jnetstream.npl.OpNode
com.voytechs.jnetstream.npl.PlusOpNode
- All Implemented Interfaces:
- BooleanNode, IntNode, LongNode, StringNode, Visitable
public class PlusOpNode
- extends OpNode
- implements IntNode, LongNode, BooleanNode, StringNode
| Fields inherited from class com.voytechs.jnetstream.npl.OpNode |
BINARY, cardinality, FLAG_NO_OP, flags, HIGH, left, LOW, MEDIUM, NORMAL, op, presedence, right, UNARY |
| 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 java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PlusOpNode
public PlusOpNode(LongNode right,
LongNode left)
- Parameters:
-
- Throws:
PlusOpNode
public PlusOpNode(StringNode right,
StringNode left)
PlusOpNode
public PlusOpNode()
getInt
public int getInt()
- Specified by:
getInt in interface IntNode
getLong
public long getLong()
- Specified by:
getLong in interface LongNode
getString
public java.lang.String getString()
- Specified by:
getString in interface StringNode
getBoolean
public boolean getBoolean()
- Specified by:
getBoolean in interface BooleanNode
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
- Creates a new node using the factory pattern. New node is
initialized using the operands from the stack.
Plus node is a binary operand node (takes 2 elements from the stack)
- 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.
main
public static void main(java.lang.String[] args)
- Test function for PlusOpNode
- Parameters:
args - command line arguments