|
Spreadsheet Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--corpus.excel.Component | +--corpus.excel.Formula
This class represents a Formula that is part of a cell.
FormulaParser
,
Cell
,
Serialized FormField Summary | |
static boolean |
loud
Dump extra debugging info. |
boolean |
processed
Has this cell been processed. |
java.lang.String[] |
sheetnames
An array of names for the sheets. |
java.lang.String |
SHEETNAMES
A pattern for matching sheetnames. |
Fields inherited from class corpus.excel.Component |
haltOnErrors |
Constructor Summary | |
Formula(Cell c,
java.lang.String input,
java.lang.String[] sheetnames)
|
|
Formula(int col,
int row,
java.lang.String input,
java.lang.String[] sheetnames)
|
Method Summary | |
Cell |
getCell()
The cell that contains this formula. |
java.util.Vector |
getCells()
Finds and returns all the cells referred to in this formula. |
int |
getComplexity()
Some guage of the formula complexity. |
java.util.Vector |
getElements()
Get all elements (cells, ranges, functions,etc...) |
java.lang.String |
getFormulaString()
Gets the String Version of this Formula. |
java.util.Vector |
getFunctions()
The functions used in this formula. |
java.util.Vector |
getRanges()
The ranges that this formula refers to. |
boolean |
isCopyEquivalent(Cell c)
Copy-Equivalence exists, if the formulas are absolutely identical (i.e. the cell contents has been copied from one cell into the other, either by copy and paste, or by retyping the same formula). |
boolean |
isLogicallyEquivalent(Formula f)
Logical-Equivalence exists, if the formulas differ only in constant values (literals) and absolute references. |
boolean |
isSourceEquivalent(Formula f)
Source-Equivalence exists, if the formulas use (potentially) all the same cells in calculation. |
boolean |
isStructurallyEquivalent(Formula f)
Structural-Equivalence exists, if the formulas consist of the same operators in the same order, but the operators may be applied to different arguments. |
static void |
main(java.lang.String[] args)
Testing of Formula functionallity. |
java.util.Vector |
parseFormula()
Turn the formula string into a sequence of excel elements using a recursive descent parser. |
javax.swing.JTree |
parseTree()
Creates a JTree to represent the parsed strucutre of the formula. |
static javax.swing.tree.DefaultMutableTreeNode |
parseTree(java.util.Vector elements)
Returns the parseTree for the given elements. |
java.lang.String |
parseTreeString()
First attempt at showing the parsetree strucutre of a formula as a multiline text String. |
static void |
printParseTree(javax.swing.tree.DefaultMutableTreeNode root,
java.lang.String indent)
Dumps the current state of the parse tree to the console. |
void |
process()
Use the information given for this formula to parse out the formula components. |
void |
setSheetNames(java.lang.String[] sheetnames)
Sheetnames are used to determine cell depth during parsing. |
int |
sheetDepth(java.lang.String input)
Given the name of a worksheet, return the depth that the sheet occurs at. |
java.lang.String |
toHTMLString()
Converts information about this component into an HTML formatted String. |
java.lang.String |
toString()
A string representation of this formula. |
static java.util.Vector |
vectorIndexOfInstance(java.util.Vector elements,
java.lang.String class_name)
Finds the all instances of class_name in elements and returns a Vector to them. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public java.lang.String[] sheetnames
public java.lang.String SHEETNAMES
public static boolean loud
public boolean processed
Constructor Detail |
public Formula(Cell c, java.lang.String input, java.lang.String[] sheetnames)
public Formula(int col, int row, java.lang.String input, java.lang.String[] sheetnames)
Method Detail |
public void process() throws java.lang.Exception
java.lang.Exception
public void setSheetNames(java.lang.String[] sheetnames)
public Cell getCell()
public boolean isCopyEquivalent(Cell c)
public boolean isLogicallyEquivalent(Formula f)
public boolean isStructurallyEquivalent(Formula f)
public boolean isSourceEquivalent(Formula f)
public java.util.Vector getCells()
public java.util.Vector getRanges()
public java.util.Vector getFunctions()
public java.util.Vector getElements()
public int getComplexity()
public java.lang.String getFormulaString()
public java.lang.String toString()
toString
in class Component
public java.lang.String toHTMLString()
toHTMLString
in class Component
public javax.swing.JTree parseTree()
public static void printParseTree(javax.swing.tree.DefaultMutableTreeNode root, java.lang.String indent)
root
- Where to start printing fromindent
- Text that is appended at each recursion through the tree.public static javax.swing.tree.DefaultMutableTreeNode parseTree(java.util.Vector elements)
elements
- The parsed tokens to convert into a parsed tree.parseTree()
public static java.util.Vector vectorIndexOfInstance(java.util.Vector elements, java.lang.String class_name)
public java.lang.String parseTreeString()
public java.util.Vector parseFormula() throws java.lang.Exception
java.lang.Exception
public int sheetDepth(java.lang.String input)
public static void main(java.lang.String[] args)
|
Spreadsheet Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |