Package math.matrix.expressParser
Class MBinaryOperator
- java.lang.Object
-
- math.matrix.expressParser.MOperator
-
- math.matrix.expressParser.MBinaryOperator
-
- All Implemented Interfaces:
Validatable
- Direct Known Subclasses:
MAdditionOperator
public class MBinaryOperator extends MOperator implements Validatable
- Author:
- GBEMIRO
-
-
Constructor Summary
Constructors Constructor Description MBinaryOperator(java.lang.String name, int index, java.util.ArrayList<java.lang.String> scan)
-
Method Summary
Modifier and Type Method Description intgetIndex()PrecedencegetPrecedence()voidsetIndex(int index, java.util.ArrayList<java.lang.String> scan)booleanvalidate(java.util.ArrayList<java.lang.String> scan)-
Methods inherited from class math.matrix.expressParser.MOperator
getName, getPrecedence, isAssignmentOperator, isBinaryOperator, isBracket, isClosingBrace, isClosingBracket, isColJoin, isColon, isCube, isDet, isDetHalfSymbol, isInverse, isMul, isOpeningBrace, isOpeningBracket, isOperatorString, isPlusOrMinus, isPower, isRowJoin, isSquare, isTri, isUnaryPostOperator, isUnaryPreOperator, isUnit, orderCompoundTokens, setName, validateAll
-
-
-
-
Constructor Detail
-
MBinaryOperator
public MBinaryOperator(java.lang.String name, int index, java.util.ArrayList<java.lang.String> scan)- Parameters:
name- the name that identifies the MBinaryOperator objectindex- The index of this operator in the scanned Function that it belongs to.scan- the scanner tokens object that this MBinaryOperator object belongs to.
-
-
Method Detail
-
getPrecedence
public Precedence getPrecedence()
- Returns:
- the precedence of this operator
-
setIndex
public void setIndex(int index, java.util.ArrayList<java.lang.String> scan)- Parameters:
index- sets the index of this operator in the scanned Function that it belongs to.scan- The scanner tokens object exists in.
-
getIndex
public int getIndex()
- Returns:
- the index of this operator in the scanned Function that it belongs to.
-
validate
public boolean validate(java.util.ArrayList<java.lang.String> scan)
- Specified by:
validatein interfaceValidatable- Parameters:
scan- the scanner tokens object that this MBinaryOperator object exists in. validates the grammatical usage of this operator (by leaving the correctFunction attribute of the function object un-modified) if the usage of this operator in its immediate environment i.e to its left and right is correct.
-
-