tree
Class Node

java.lang.Object
  |
  +--java.lang.Number
        |
        +--tree.Node
Direct Known Subclasses:
Node.Binary, Node.Unary

public abstract class Node
extends java.lang.Number
implements java.io.Serializable

base class to store and evaluate arithmetic expressions. Defines most value-functions so that subclasses need only deal with long and double arithmetic.

See Also:
Serialized Form

Inner Class Summary
static class Node.Add
          implements addition.
protected static class Node.Binary
          represents a binary operator.
static class Node.Div
          implements division.
static class Node.Minus
          implements sign change.
static class Node.Mul
          implements multiplication.
static class Node.Sub
          implements subtraction.
protected static class Node.Unary
          represents a unary operator.
 
Constructor Summary
protected Node()
          JDK 1.2 requires this.
 
Method Summary
 byte byteValue()
          maps byte arithmetic to long.
 float floatValue()
          maps float arithmetic to double.
 int intValue()
          maps int arithmetic to long.
 short shortValue()
          maps short arithmetic to long.
 
Methods inherited from class java.lang.Number
doubleValue, longValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

protected Node()
JDK 1.2 requires this.
Method Detail

byteValue

public byte byteValue()
maps byte arithmetic to long.
Overrides:
byteValue in class java.lang.Number
Returns:
truncated long value.

shortValue

public short shortValue()
maps short arithmetic to long.
Overrides:
shortValue in class java.lang.Number
Returns:
truncated long value.

intValue

public int intValue()
maps int arithmetic to long.
Overrides:
intValue in class java.lang.Number
Returns:
truncated long value.

floatValue

public float floatValue()
maps float arithmetic to double.
Overrides:
floatValue in class java.lang.Number
Returns:
truncated double value.