JComponentPack 1.5.0

com.zfqjava.formula
Class FormulaFactory

java.lang.Object
  extended by com.zfqjava.formula.FormulaFactory
Direct Known Subclasses:
CellFormulaFactory

public abstract class FormulaFactory
extends Object


Constructor Summary
FormulaFactory()
           
 
Method Summary
abstract  void addFunction(Function function)
          Adds a function.
abstract  Formula createFormula(String s)
          Creates a formula object for the specified string.
abstract  Formula createFormula(String s, FormulaContext context)
          Creates a formula object for the specified string with the specified FormulaContext.
abstract  Formula createFormula(String s, FormulaContext context, boolean allowErrorFormula)
          Creates a formula object for the specified string with the specified FormulaContext.
 FormulaContext createFormulaContext()
          Creates the default FormulaContext, default return null
abstract  String[] getAllFunctionNames()
          Returns all supported function names.
 char getArgumentSeparatorChar()
           
static FormulaFactory getDefault()
          Returns the default formula factory.
static char getDefaultArgumentSeparatorChar()
           
static char getDefaultStringEscapeChar()
          Returns the default string escape char.
abstract  Function getFunction(String name)
          Returns the function for the specified name.
 char getStringEscapeChar()
          Returns the string escape char.
abstract  void removeFunction(String name)
          Removes a function.
 void setArgumentSeparatorChar(char argumentSeparatorChar)
           
static void setDefault(FormulaFactory factory)
          Sets the the default formula factory.
static void setDefaultArgumentSeparatorChar(char aDefaultArgumentSeparatorChar)
           
static void setDefaultStringEscapeChar(char c)
          Sets the default string escape char.
 void setStringEscapeChar(char c)
          Sets the string escape char.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormulaFactory

public FormulaFactory()
Method Detail

getDefault

public static FormulaFactory getDefault()
Returns the default formula factory.

Returns:
the default formula factory

setDefault

public static void setDefault(FormulaFactory factory)
Sets the the default formula factory.

Parameters:
factory - the formula factory

setDefaultStringEscapeChar

public static void setDefaultStringEscapeChar(char c)
Sets the default string escape char.

Parameters:
c - the default string escape char
Since:
JDataGrid 2.0
See Also:
getDefaultStringEscapeChar()

getDefaultStringEscapeChar

public static char getDefaultStringEscapeChar()
Returns the default string escape char.

Returns:
the default string escape char
Since:
JDataGrid 2.0
See Also:
setDefaultStringEscapeChar(char)

createFormula

public abstract Formula createFormula(String s)
                               throws ParseException
Creates a formula object for the specified string.

Parameters:
s - the formula string
Returns:
the formula object
Throws:
ParseException

createFormula

public abstract Formula createFormula(String s,
                                      FormulaContext context)
                               throws ParseException
Creates a formula object for the specified string with the specified FormulaContext.

Parameters:
s - the formula string
context - the formula context
Returns:
the formula object
Throws:
ParseException
Since:
JDataGrid 2.0

createFormula

public abstract Formula createFormula(String s,
                                      FormulaContext context,
                                      boolean allowErrorFormula)
                               throws ParseException
Creates a formula object for the specified string with the specified FormulaContext.

Parameters:
s - the formula string
context - the formula context
allowErrorFormula - allow create the error formula
Returns:
the formula object
Throws:
ParseException
Since:
JDataGrid 2.1.0

getFunction

public abstract Function getFunction(String name)
Returns the function for the specified name.

Parameters:
name - the function name
Returns:
the function object

addFunction

public abstract void addFunction(Function function)
Adds a function.

Parameters:
function - the function

removeFunction

public abstract void removeFunction(String name)
Removes a function.

Parameters:
name - the function name

getAllFunctionNames

public abstract String[] getAllFunctionNames()
Returns all supported function names.

Returns:
all supported function names
Since:
JDataGrid 2.0

setStringEscapeChar

public void setStringEscapeChar(char c)
Sets the string escape char.

Parameters:
c - the string escape char
Since:
JDataGrid 1.6.1
See Also:
getStringEscapeChar()

getStringEscapeChar

public char getStringEscapeChar()
Returns the string escape char.

Returns:
the string escape char
Since:
JDataGrid 1.6.1
See Also:
setStringEscapeChar(char)

getDefaultArgumentSeparatorChar

public static char getDefaultArgumentSeparatorChar()
Since:
JDataGrid 2.0

setDefaultArgumentSeparatorChar

public static void setDefaultArgumentSeparatorChar(char aDefaultArgumentSeparatorChar)
Since:
JDataGrid 2.0

getArgumentSeparatorChar

public char getArgumentSeparatorChar()
Since:
JDataGrid 2.0

setArgumentSeparatorChar

public void setArgumentSeparatorChar(char argumentSeparatorChar)
Since:
JDataGrid 2.0

createFormulaContext

public FormulaContext createFormulaContext()
Creates the default FormulaContext, default return null


JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.