|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.expression4j.factory.ExpressionFactory
public final class ExpressionFactory
Factory used to create - Expression - Catalog - Parameters and to get the default Catalog. Default catalog is catalog who store all functions created by factory.
Constructor Summary | |
---|---|
ExpressionFactory()
|
Method Summary | |
---|---|
static Catalog |
createCatalog(java.lang.String catalogName)
Create an empty catalog. |
static Expression |
createExpression(java.lang.String expression)
Create an expression. |
static Expression |
createExpression(java.lang.String expression,
Catalog catalog)
Create an expression with the given catalog. |
static Expression |
createExpression(java.lang.String expression,
Catalog catalog,
ExpressionModel model)
Create an expression with the given catalog and the given expression model. |
static Parameters |
createParameters()
Create an empty parameters |
static Catalog |
getCatalog()
get the default catalog with all expression created by the factory. |
static Catalog |
getCatalog(java.lang.String catalogName)
get the specified catalog. |
static java.util.List |
getCatalogList()
get catalog list. |
static Expression |
optimizeExpression(Expression expression)
Optimize expression Sample: f(x)=2+5-4*x+3*2 => f2(x)=13-4*x |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExpressionFactory()
Method Detail |
---|
public static Expression createExpression(java.lang.String expression) throws ParsingException
expression
- String of the expression.
ParsingException
- when expression is not valid.public static Expression createExpression(java.lang.String expression, Catalog catalog) throws ParsingException
expression
- String of the expression.catalog
- catalog to use to create function.
ParsingException
- when expression is not valid.public static Expression createExpression(java.lang.String expression, Catalog catalog, ExpressionModel model) throws ParsingException
expression
- String of the expression.catalog
- catalog to use to create function.model
- model tu use to parse expression.
ParsingException
- when expression is not valid.public static Catalog createCatalog(java.lang.String catalogName)
catalogName
- name of the catalog. This name is unique. Crate a new catalog with the same name return the same catalog.
public static Parameters createParameters()
public static Catalog getCatalog()
public static Catalog getCatalog(java.lang.String catalogName)
catalogName
- requested catalog name.
null
if not.public static java.util.List getCatalogList()
public static Expression optimizeExpression(Expression expression)
expression
- expression to optimize
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |