|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.expression4j.core.impl.CatalogImpl
public class CatalogImpl
Implementation of catalog interface.
All catalog store the default functions derived from java Math class: - abs(x) - acos(x) - asin(x) - atan(x) - ceil(x) - cos(x) - cosh(x) - exp(x) - floor(x) - log(x) - random() - sin(x) - sinh(x) - sqrt(x) - tan(x) and default constant - pi = 3.14159 ... - e = 2,71828182845904523536028747135266249
Field Summary | |
---|---|
protected java.util.Map |
catalog
|
protected java.util.Map |
constant
|
protected java.lang.String |
name
|
Constructor Summary | |
---|---|
CatalogImpl(java.lang.String catalogName)
|
Method Summary | |
---|---|
void |
addConstant(java.lang.String name,
MathematicalElement value)
Add a constant to the catalog. |
void |
addExpression(Expression expression)
add an expression to catalog. |
MathematicalElement |
getConstant(java.lang.String name)
Get a constant from the catalog |
Expression |
getExpression(java.lang.String name)
Get an expression from the catalog. |
java.lang.String |
getName()
Get the catalog name. |
java.util.List |
listConstant()
List all constant stored in catalog. |
java.util.List |
listExpression()
List the content of the catalog |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Map catalog
protected java.util.Map constant
protected java.lang.String name
Constructor Detail |
---|
public CatalogImpl(java.lang.String catalogName)
Method Detail |
---|
public void addExpression(Expression expression)
Catalog
addExpression
in interface Catalog
expression
- expression to add.public Expression getExpression(java.lang.String name)
Catalog
getExpression
in interface Catalog
name
- name of the expression to get
public java.util.List listExpression()
Catalog
listExpression
in interface Catalog
public java.lang.String toString()
toString
in class java.lang.Object
public void addConstant(java.lang.String name, MathematicalElement value)
Catalog
addConstant
in interface Catalog
name
- name of the constant.value
- value of the constant.public MathematicalElement getConstant(java.lang.String name)
Catalog
getConstant
in interface Catalog
name
- constant name to get.
null
if not found.public java.util.List listConstant()
Catalog
listConstant
in interface Catalog
public java.lang.String getName()
Catalog
getName
in interface Catalog
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |