Package uk.co.cogitolearning.cogpar
Class SequenceExpressionNode
- java.lang.Object
-
- uk.co.cogitolearning.cogpar.SequenceExpressionNode
-
- All Implemented Interfaces:
ExpressionNode
- Direct Known Subclasses:
AdditionExpressionNode,MultiplicationExpressionNode
public abstract class SequenceExpressionNode extends Object implements ExpressionNode
A base class for AdditionExpressionNode and MultiplicationExpressionNode. Holds an arbitrary number of ExpressionNodes together with boolean flags.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSequenceExpressionNode.TermAn inner class that defines a pair containing an ExpressionNode and a boolean flag.
-
Field Summary
Fields Modifier and Type Field Description protected ArrayList<SequenceExpressionNode.Term>termsthe list of terms in the sequence-
Fields inherited from interface uk.co.cogitolearning.cogpar.ExpressionNode
ADDITION_NODE, CONSTANT_NODE, EXPONENTIATION_NODE, FUNCTION_NODE, MULTIPLICATION_NODE, VARIABLE_NODE
-
-
Constructor Summary
Constructors Constructor Description SequenceExpressionNode()Default constructor.SequenceExpressionNode(ExpressionNode node, boolean positive)Constructor to create a sequence with the first term already added.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(ExpressionNode node, boolean positive)Add another term to the sequence-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface uk.co.cogitolearning.cogpar.ExpressionNode
accept, getType, getValue
-
-
-
-
Field Detail
-
terms
protected final ArrayList<SequenceExpressionNode.Term> terms
the list of terms in the sequence
-
-
Constructor Detail
-
SequenceExpressionNode
public SequenceExpressionNode()
Default constructor.
-
SequenceExpressionNode
public SequenceExpressionNode(ExpressionNode node, boolean positive)
Constructor to create a sequence with the first term already added.- Parameters:
node- the term to be addedpositive- a boolean flag
-
-
Method Detail
-
add
public void add(ExpressionNode node, boolean positive)
Add another term to the sequence- Parameters:
node- the term to be addedpositive- a boolean flag
-
-