visad.formula
Class FormulaManager
- java.lang.Object
-
- visad.formula.FormulaManager
-
public class FormulaManager extends java.lang.ObjectThe FormulaManager class is the gateway into the visad.formula package, a general-purpose formula parser and evaluator. Variables update automatically when the variables upon which they depend change. For an example of usage, see the FormulaUtil.createStandardManager() method.
-
-
Constructor Summary
Constructors Constructor and Description FormulaManager(java.lang.String[] binOps, int[] binPrec, java.lang.String[] binMethods, java.lang.String[] unaryOps, int[] unaryPrec, java.lang.String[] unaryMethods, java.lang.String[] functions, java.lang.String[] funcMethods, int implicitPrec, java.lang.String[] implicitMethods, java.lang.String preParseMethod)construct a new FormulaManager object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidassignFormula(java.lang.String name, java.lang.String formula)assign a formula to a variablebooleancanBeRemoved(java.lang.String name)check whether it is safe to remove a variable from the databasevoidcreateVar(java.lang.String name, ThingReference tr)add a variable to the database that uses tr as its ThingReferencebooleanexists(java.lang.String name)check whether a given variable is currently in the databasejava.lang.String[]getErrors(java.lang.String name)get the current list of errors that occurred when evaluating "name" and clear the listjava.lang.StringgetFormula(java.lang.String name)get a variable's current formulaThingReferencegetReference(java.lang.String name)get a variable's associated ThingReferenceThinggetThing(java.lang.String name)get a variable's current valuevoidremove(java.lang.String name)remove a variable from the databasevoidsetReference(java.lang.String name, ThingReference tr)set a variable's ThingReferencevoidsetTextRef(java.lang.String name, ThingReference textRef)set a variable to auto-update its formula based on a Text object referenced by a ThingReference (useful for remote formula updates)voidsetThing(java.lang.String name, Thing t)set a variable's value directlyvoidwaitForFormula(java.lang.String name)blocks until this variable's formula is finished computing
-
-
-
Constructor Detail
-
FormulaManager
public FormulaManager(java.lang.String[] binOps, int[] binPrec, java.lang.String[] binMethods, java.lang.String[] unaryOps, int[] unaryPrec, java.lang.String[] unaryMethods, java.lang.String[] functions, java.lang.String[] funcMethods, int implicitPrec, java.lang.String[] implicitMethods, java.lang.String preParseMethod) throws FormulaExceptionconstruct a new FormulaManager object- Throws:
FormulaException
-
-
Method Detail
-
createVar
public void createVar(java.lang.String name, ThingReference tr) throws VisADExceptionadd a variable to the database that uses tr as its ThingReference- Throws:
VisADException
-
assignFormula
public void assignFormula(java.lang.String name, java.lang.String formula) throws VisADExceptionassign a formula to a variable- Throws:
VisADException
-
waitForFormula
public void waitForFormula(java.lang.String name) throws VisADExceptionblocks until this variable's formula is finished computing- Throws:
VisADException
-
setTextRef
public void setTextRef(java.lang.String name, ThingReference textRef) throws VisADException, java.rmi.RemoteExceptionset a variable to auto-update its formula based on a Text object referenced by a ThingReference (useful for remote formula updates)- Throws:
VisADExceptionjava.rmi.RemoteException
-
getErrors
public java.lang.String[] getErrors(java.lang.String name)
get the current list of errors that occurred when evaluating "name" and clear the list
-
canBeRemoved
public boolean canBeRemoved(java.lang.String name) throws FormulaExceptioncheck whether it is safe to remove a variable from the database- Throws:
FormulaException
-
exists
public boolean exists(java.lang.String name)
check whether a given variable is currently in the database
-
remove
public void remove(java.lang.String name) throws FormulaExceptionremove a variable from the database- Throws:
FormulaException
-
setThing
public void setThing(java.lang.String name, Thing t) throws VisADException, java.rmi.RemoteExceptionset a variable's value directly- Throws:
VisADExceptionjava.rmi.RemoteException
-
setReference
public void setReference(java.lang.String name, ThingReference tr) throws VisADExceptionset a variable's ThingReference- Throws:
VisADException
-
getThing
public Thing getThing(java.lang.String name) throws FormulaException
get a variable's current value- Throws:
FormulaException
-
getReference
public ThingReference getReference(java.lang.String name) throws FormulaException
get a variable's associated ThingReference- Throws:
FormulaException
-
getFormula
public java.lang.String getFormula(java.lang.String name) throws FormulaExceptionget a variable's current formula- Throws:
FormulaException
-
-
DMelt 3.0 © DataMelt by jWork.ORG