HEADER

ru.biosoft.math.model
Class AstFunctionDeclaration

ru.biosoft.math.model.SimpleNode
  |
  +--ru.biosoft.math.model.AstFunctionDeclaration

public class AstFunctionDeclaration
extends SimpleNode
implements Function, ParserContext

Function declaration, it corresponds lambda element in MathML. Function declaration syntax is following:

FunctionDeclaration ::= ( "function" Identifier "(" ArgumentDeclaration ( "," ArgumentDeclaration )* ")"  Expression )
Example:
 function f(x, y) = sin(x) + cos(y); 
Parser contex issues: Linear parser checks whether the function uses declared variables, for this purpose it uses its own parser context.
Constructor Summary
AstFunctionDeclaration(int id)
           

Method Summary
 booleancontainsConstant(String name)
           
 booleancontainsVariable(String name)
           
 voiddeclareConstant(String name, Object value)
           
 voiddeclareFunction(Function function)
           
 voiddeclareVariable(String name, Object value)
           
 ObjectgetConstantValue(String name)
           
 FunctiongetFunction(String name)
           
 StringgetName()
           
 intgetNumberOfParameters()
           
 intgetPriority()
           
 ObjectgetVariableValue(String name)
           
 voidinit(ParserContext parent)
           
 voidsetName(String name)
           
 StringtoString()
           

Methods inherited from class ru.biosoft.math.model.SimpleNode
dump, dump, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtOpen, jjtReplaceChild, jjtSetParent, toString

Constructor Detail

AstFunctionDeclaration

public AstFunctionDeclaration(int id)
Method Detail

containsConstant

public boolean containsConstant(String name)

containsVariable

public boolean containsVariable(String name)

declareConstant

public void declareConstant(String name, Object value)

declareFunction

public void declareFunction(Function function)

declareVariable

public void declareVariable(String name, Object value)

getConstantValue

public Object getConstantValue(String name)

getFunction

public Function getFunction(String name)

getName

public String getName()

getNumberOfParameters

public int getNumberOfParameters()

getPriority

public int getPriority()

getVariableValue

public Object getVariableValue(String name)

init

public void init(ParserContext parent)

setName

public void setName(String name)

toString

public String toString()

Association Links

to Class java.lang.String

Function name.

to Class ru.biosoft.math.model.ParserContext

to Class java.util.HashMap


FOOTER

BOTTOM