spreadsheet
Class Spreadsheet

java.lang.Object
  |
  +--spreadsheet.Spreadsheet

public class Spreadsheet
extends java.lang.Object


Constructor Summary
Spreadsheet()
          Constructs a Spreadsheet.
 
Method Summary
 void addSpreadsheetListener(SpreadsheetListener sl)
          Register a new listener for refresh events.
 float calculateFunction(Expression expr)
          Enable Functions to calculate arbitrary sub-functions.
 void clearFunction()
          Clears all existing functions
 void clearValues()
          Clears all nodes from the hashtable.
 Expression getExpression(Cell cell)
          Returns the expression of a node identified by a specific cell
 Function getFunction(java.lang.String name)
          Retrieves a particular function from the spreadsheet.
 float getNumericValue(Cell cell)
          Returns the floating point equivalent of a cell location.
 java.lang.String getValue(Cell c)
          Returns the value of a node in the spreadsheet at specific cell.
 void insertValue(Cell dest, java.lang.String value)
          Request to insert a given value into a destination cell.
 void recalculate(Cell dest)
          Request to recalculate the spreadsheet starting from the given cell.
 void refresh(CellRegion destRegion)
          Request to refresh the given destination cell region
 void removeSpreadsheetListener(SpreadsheetListener sl)
          de-register a new listener for refresh events.
 void setFunction(java.lang.String name, Function f)
          Installs a function to the spreadsheet.
 void setValue(Cell dest, java.lang.String value)
          Sets the value of a node given by the string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Spreadsheet

public Spreadsheet()
Constructs a Spreadsheet.
Method Detail

setFunction

public void setFunction(java.lang.String name,
                        Function f)
Installs a function to the spreadsheet.
Parameters:
name - is the name of the desired function
f - is an object that implements this function
See Also:
getFunction(java.lang.String), clearFunction()

getFunction

public Function getFunction(java.lang.String name)
Retrieves a particular function from the spreadsheet.
Parameters:
name - is the name of the desired function
See Also:
setFunction(java.lang.String, spreadsheet.Function), clearFunction()

clearFunction

public void clearFunction()
Clears all existing functions
See Also:
getFunction(java.lang.String), setFunction(java.lang.String, spreadsheet.Function)

getValue

public java.lang.String getValue(Cell c)
Returns the value of a node in the spreadsheet at specific cell.
Parameters:
cell - is the target cell
Since:
version 1.1

getExpression

public Expression getExpression(Cell cell)
Returns the expression of a node identified by a specific cell
Parameters:
cell - is the target cell
Returns:
the Expression (or null) contained by the spreadsheet at that cell.

setValue

public void setValue(Cell dest,
                     java.lang.String value)
Sets the value of a node given by the string. Note: This will not force refresh events to be generated. If this is the desired behavior, use insertValue
Since:
version 1.1
See Also:
insertValue(spreadsheet.Cell, java.lang.String)

clearValues

public void clearValues()
Clears all nodes from the hashtable.
Since:
version 1.1

getNumericValue

public float getNumericValue(Cell cell)
Returns the floating point equivalent of a cell location.
Parameters:
cell - is the target cell

calculateFunction

public float calculateFunction(Expression expr)
                        throws FunctionException
Enable Functions to calculate arbitrary sub-functions.
Parameters:
expr - is an Expression to be evaluated.
Throws:
FunctionException - if an argument is an unknown function

insertValue

public void insertValue(Cell dest,
                        java.lang.String value)
Request to insert a given value into a destination cell. Note: This will generate Refresh Events. If this is not the intended behavior, use setValue.
See Also:
setValue(spreadsheet.Cell, java.lang.String)

recalculate

public void recalculate(Cell dest)
Request to recalculate the spreadsheet starting from the given cell.
Parameters:
dest - is the target cell to start the recalculation.

refresh

public void refresh(CellRegion destRegion)
Request to refresh the given destination cell region
Parameters:
destRegion - is a region to be refreshed.

addSpreadsheetListener

public void addSpreadsheetListener(SpreadsheetListener sl)
Register a new listener for refresh events.
Parameters:
sl - is a SpreadsheetListener.

removeSpreadsheetListener

public void removeSpreadsheetListener(SpreadsheetListener sl)
de-register a new listener for refresh events.
Parameters:
sl - is a SpreadsheetListener.