Spreadsheet Toolkit

corpus.excel
Class Function

java.lang.Object
  |
  +--corpus.excel.Component
        |
        +--corpus.excel.FormulaComponent
              |
              +--corpus.excel.Function
All Implemented Interfaces:
java.io.Serializable

public class Function
extends FormulaComponent

Used to store the internal representation of a Function.

See Also:
FunctionParser, Serialized Form

Field Summary
 
Fields inherited from class corpus.excel.FormulaComponent
formula
 
Fields inherited from class corpus.excel.Component
haltOnErrors
 
Constructor Summary
Function(java.lang.String name)
           
Function(java.lang.String name, java.lang.String argument)
           
 
Method Summary
 boolean compare(Function f)
           
static int[] countCatagory(Function[] funs)
          Takes an array of functions and counts how many occupy each of the different categories.
 java.lang.String getArguments()
           
 java.lang.String getCatagory()
          Figures out which catagory this function belongs to.
 java.util.Vector getElements()
           
 java.lang.String getName()
           
 boolean isDATABASE()
           
 boolean isDATEANDTIME()
           
 boolean isENGINEERING()
           
 boolean isFINANCIAL()
           
 boolean isINFORMATION()
           
 boolean isLOGICAL()
           
 boolean isLOOKUPANDREFERENCE()
           
 boolean isMATHANDTRIG()
           
 boolean isSTATISTICAL()
           
 boolean isTEXT()
           
 int length()
          Unlike of parseOneElement() type parsers, this one must perform multiple matches.
static void main(java.lang.String[] args)
           
 javax.swing.tree.DefaultMutableTreeNode parseTree()
          Creates a parseTree for this FormulaComponent and any of its sub components.
 void setElements(java.util.Vector elements)
          Sets the sub elements to those parsed by the FormulaParser.
static java.util.Vector[] sortCatagory(Function[] funs)
          Takes an array of functions and sorts them into an array of vectors based on catagory.
 java.lang.String toHTMLString()
          Converts information about this component into an HTML formatted String.
 java.lang.String toString()
          THE LENGTH OF THE RETURNED STRING SHOULD MATCH THE LENGTH OF THE PARSED INPUT!
 
Methods inherited from class corpus.excel.FormulaComponent
getReferingFormula
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Function

public Function(java.lang.String name)

Function

public Function(java.lang.String name,
                java.lang.String argument)
Method Detail

setElements

public void setElements(java.util.Vector elements)
Sets the sub elements to those parsed by the FormulaParser.


getElements

public java.util.Vector getElements()

toString

public java.lang.String toString()
THE LENGTH OF THE RETURNED STRING SHOULD MATCH THE LENGTH OF THE PARSED INPUT!

Specified by:
toString in class Component

toHTMLString

public java.lang.String toHTMLString()
Converts information about this component into an HTML formatted String.

Specified by:
toHTMLString in class Component

parseTree

public javax.swing.tree.DefaultMutableTreeNode parseTree()
Creates a parseTree for this FormulaComponent and any of its sub components.

Overrides:
parseTree in class FormulaComponent
Returns:
A DefaultMutableTreeNode representing this FormulaComponent and any sub components it may have.

getName

public java.lang.String getName()

getArguments

public java.lang.String getArguments()

compare

public boolean compare(Function f)
Returns:
true if this function is structually equivalent to the argument funciton

getCatagory

public java.lang.String getCatagory()
Figures out which catagory this function belongs to.


countCatagory

public static int[] countCatagory(Function[] funs)
Takes an array of functions and counts how many occupy each of the different categories.


sortCatagory

public static java.util.Vector[] sortCatagory(Function[] funs)
Takes an array of functions and sorts them into an array of vectors based on catagory.


isLOOKUPANDREFERENCE

public boolean isLOOKUPANDREFERENCE()

isINFORMATION

public boolean isINFORMATION()

isFINANCIAL

public boolean isFINANCIAL()

isENGINEERING

public boolean isENGINEERING()

isDATEANDTIME

public boolean isDATEANDTIME()

isDATABASE

public boolean isDATABASE()

isMATHANDTRIG

public boolean isMATHANDTRIG()

isSTATISTICAL

public boolean isSTATISTICAL()

isTEXT

public boolean isTEXT()

isLOGICAL

public boolean isLOGICAL()

length

public int length()
Unlike of parseOneElement() type parsers, this one must perform multiple matches. For example, =SUM(...) and =SUMIF(...) With out multiple checking only the firt will succeed.


main

public static void main(java.lang.String[] args)
                 throws gnu.regexp.REException
gnu.regexp.REException

Spreadsheet Toolkit

Project Home Page