edu.psu.geovista.app.spreadsheet.formula
Class Formula

java.lang.Object
  extended byedu.psu.geovista.app.spreadsheet.formula.Formula

public class Formula
extends java.lang.Object


Constructor Summary
Formula(Cell owner, java.lang.String input, int row, int col)
          edu.psu.geovista.app.spreadsheet.formula.Formula contructor.
Formula(java.lang.String input, int row, int col, ParserException e)
          edu.psu.geovista.app.spreadsheet.formula.Formula contructor.
 
Method Summary
 boolean addOwner(Cell cell)
           
 java.lang.Number evaluate()
           
 java.lang.Number evaluate(java.util.LinkedList postfix)
          It evaluates the postfix expression by a stack.
 FunctionManager getFunctionManager()
           
 Cell getOwner()
           
 java.util.HashSet getOwners()
          From the edu.psu.geovista.app.spreadsheet.formula.Node list; Creates the dependency set.
 java.lang.Number getValue()
          Return value *
 boolean isBad()
          Check for bad edu.psu.geovista.app.spreadsheet.formula.
 boolean needsRecalc()
          Check whether needs a recalc
static java.lang.Number processCellValue(java.lang.Object o)
           
 void setBad()
           
 void setNeedsRecalc(boolean needs)
          Mark it as needsRecalc
 java.lang.String toString()
          This returns the string value of the edu.psu.geovista.app.spreadsheet.formula.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Formula

public Formula(java.lang.String input,
               int row,
               int col,
               ParserException e)
edu.psu.geovista.app.spreadsheet.formula.Formula contructor. This is used to construct a edu.psu.geovista.app.spreadsheet.formula.Formula object without any parsing process.

Parameters:
input - the edu.psu.geovista.app.spreadsheet.formula string
row - the current row where the edu.psu.geovista.app.spreadsheet.formula is stored
col - the current column where the forluma is stored
e - a edu.psu.geovista.app.spreadsheet.exception.ParserException

Formula

public Formula(Cell owner,
               java.lang.String input,
               int row,
               int col)
        throws ParserException
edu.psu.geovista.app.spreadsheet.formula.Formula contructor. Parse the input string and translate into postfix form.

Parameters:
input - the edu.psu.geovista.app.spreadsheet.formula string
row - the current row where the edu.psu.geovista.app.spreadsheet.formula is stored
col - the current column where the forluma is stored
See Also:
#toPostfix
Method Detail

getValue

public java.lang.Number getValue()
Return value *


isBad

public boolean isBad()
Check for bad edu.psu.geovista.app.spreadsheet.formula.

Returns:
boolean true if postfix

setBad

public void setBad()

needsRecalc

public boolean needsRecalc()
Check whether needs a recalc

Returns:
boolean true if needs recalculation

setNeedsRecalc

public void setNeedsRecalc(boolean needs)
Mark it as needsRecalc


getOwners

public java.util.HashSet getOwners()
From the edu.psu.geovista.app.spreadsheet.formula.Node list; Creates the dependency set.

Returns:
a HashSet of edu.psu.geovista.app.spreadsheet.formula.CellPoint that the current cell references

getOwner

public Cell getOwner()

addOwner

public boolean addOwner(Cell cell)

toString

public java.lang.String toString()
This returns the string value of the edu.psu.geovista.app.spreadsheet.formula.

Returns:
the string value

getFunctionManager

public FunctionManager getFunctionManager()

evaluate

public java.lang.Number evaluate()
                          throws ParserException,
                                 NoReferenceException
Throws:
ParserException
NoReferenceException

evaluate

public java.lang.Number evaluate(java.util.LinkedList postfix)
                          throws ParserException,
                                 NoReferenceException
It evaluates the postfix expression by a stack.

Parameters:
postfix - the edu.psu.geovista.app.spreadsheet.formula in postfix form
Returns:
the result as a Float object
Throws:
ParserException
NoReferenceException

processCellValue

public static java.lang.Number processCellValue(java.lang.Object o)
                                         throws ParserException,
                                                NoReferenceException
Throws:
ParserException
NoReferenceException


Copyright © 1996-2003 GeoVista Center. All Rights Reserved.