org.statcato.calculator
Class CompUnit

java.lang.Object
  extended by org.statcato.calculator.CompUnit

public class CompUnit
extends java.lang.Object

A computational unit. Contains the type of the computational object and the value (a double value or a vector of doubles).

Since:
1.0
Version:
%I%, %G%
Author:
Margaret Yau
See Also:
Token

Constructor Summary
CompUnit(int type, java.lang.Object value)
          Constructor, given the type of the unit and the value.
 
Method Summary
 java.util.Vector<java.lang.Double> getColumn()
          Returns the column represented by this unit
 double getNumber()
          Returns the number value represented by this unit.
 int getType()
          Returns the type of this unit
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompUnit

public CompUnit(int type,
                java.lang.Object value)
Constructor, given the type of the unit and the value.

Parameters:
type - type of unit (Token.COLUMN or Token.NUMBER)
value - Double for a number or Vector<Double> for a column
See Also:
Token
Method Detail

getNumber

public double getNumber()
Returns the number value represented by this unit.

Returns:
number

getColumn

public java.util.Vector<java.lang.Double> getColumn()
Returns the column represented by this unit

Returns:
column (vector of doubles)

getType

public int getType()
Returns the type of this unit

Returns:
type

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object