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

A base class for AdditionExpressionNode and MultiplicationExpressionNode. More...

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

Classes

class  Term
 An inner class that defines a pair containing an ExpressionNode and a boolean flag. More...

Public Member Functions

 SequenceExpressionNode ()
 Default constructor.
 SequenceExpressionNode (ExpressionNode a, boolean positive)
 Constructor to create a sequence with the first term already added.
void add (ExpressionNode node, boolean positive)
 Add another term to the sequence.
- Public Member Functions inherited from uk.co.cogitolearning.cogpar.ExpressionNode
int getType ()
 Returns the type of the node.ExpressionNode.
double getValue ()
 Calculates and returns the value of the sub-expression represented by the node.
void accept (ExpressionNodeVisitor visitor)
 Method needed for the visitor design pattern.

Protected Attributes

ArrayList< Termterms
 the list of terms in the sequence

Additional Inherited Members

- Static Public Attributes inherited from uk.co.cogitolearning.cogpar.ExpressionNode
static final int VARIABLE_NODE = 1
 Node id for variable nodes.
static final int CONSTANT_NODE = 2
 Node id for constant nodes.
static final int ADDITION_NODE = 3
 Node id for addition nodes.
static final int MULTIPLICATION_NODE = 4
 Node id for multiplication nodes.
static final int EXPONENTIATION_NODE = 5
 Node id for exponentiation nodes.
static final int FUNCTION_NODE = 6
 Node id for function nodes.

Detailed Description

A base class for AdditionExpressionNode and MultiplicationExpressionNode.

Holds an arbitrary number of ExpressionNodes together with boolean flags.

Definition at line 35 of file SequenceExpressionNode.java.

Constructor & Destructor Documentation

uk.co.cogitolearning.cogpar.SequenceExpressionNode.SequenceExpressionNode ( ExpressionNode  a,
boolean  positive 
)

Constructor to create a sequence with the first term already added.

Parameters
nodethe term to be added
positivea boolean flag

Definition at line 80 of file SequenceExpressionNode.java.

Member Function Documentation

void uk.co.cogitolearning.cogpar.SequenceExpressionNode.add ( ExpressionNode  node,
boolean  positive 
)

Add another term to the sequence.

Parameters
nodethe term to be added
positivea boolean flag

Definition at line 93 of file SequenceExpressionNode.java.


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