CogPar
A versatile parser for mathematical expressions.
 All Classes Functions Variables
Public Member Functions | Private Attributes | List of all members
uk.co.cogitolearning.cogpar.SetVariable Class Reference

A visitor that sets a variable with a specific name to a given value. More...

Inheritance diagram for uk.co.cogitolearning.cogpar.SetVariable:
Inheritance graph
[legend]
Collaboration diagram for uk.co.cogitolearning.cogpar.SetVariable:
Collaboration graph
[legend]

Public Member Functions

 SetVariable (String name, double value)
 Construct the visitor with the name and the value of the variable to set.
void visit (VariableExpressionNode node)
 Checks the nodes name against the name to set and sets the value if the two strings match.
void visit (ConstantExpressionNode node)
 Do nothing.
void visit (AdditionExpressionNode node)
 Do nothing.
void visit (MultiplicationExpressionNode node)
 Do nothing.
void visit (ExponentiationExpressionNode node)
 Do nothing.
void visit (FunctionExpressionNode node)
 Do nothing.

Private Attributes

String name
double value

Detailed Description

A visitor that sets a variable with a specific name to a given value.

Definition at line 30 of file SetVariable.java.

Constructor & Destructor Documentation

uk.co.cogitolearning.cogpar.SetVariable.SetVariable ( String  name,
double  value 
)

Construct the visitor with the name and the value of the variable to set.

Parameters
namethe name of the variable
valuethe value of the variable

Definition at line 44 of file SetVariable.java.


The documentation for this class was generated from the following file: