Package math.matrix.expressParser
Class MUnaryPostOperator
- java.lang.Object
-
- math.matrix.expressParser.MOperator
-
- math.matrix.expressParser.MUnaryPostOperator
-
- All Implemented Interfaces:
Validatable
public class MUnaryPostOperator extends MOperator implements Validatable
Models a post-operand MOperator object e.g the !, inverse, square, cube operators- Author:
- GBEMIRO
-
-
Constructor Summary
Constructors Constructor Description MUnaryPostOperator(java.lang.String name, int index, java.util.ArrayList<java.lang.String> scan)Creates a new MUnaryPostOperator object
-
Method Summary
Modifier and Type Method Description static voidassignCompoundTokens(java.util.ArrayList<java.lang.String> scan)Carefully interpretes the correct arrangement of a loose math statement for objects of this class and applies the correct one to the Function object.PrecedencegetPrecedence()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
-
MUnaryPostOperator
public MUnaryPostOperator(java.lang.String name, int index, java.util.ArrayList<java.lang.String> scan)Creates a new MUnaryPostOperator object- Parameters:
name- The name that identifies this MUnaryPostOperator objectscan- The scanner tokens object that contains this object
-
-
Method Detail
-
getPrecedence
public Precedence getPrecedence()
- Returns:
- the Precedence of this MOperator object.
-
validate
public boolean validate(java.util.ArrayList<java.lang.String> scan)
- Specified by:
validatein interfaceValidatable- Parameters:
scan- The scanner output that this MUnaryPostOperator 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.- Returns:
- true if the grammatical usage of this token with repect to its 2 immediate neighbouring tokens to the left and to the right is correct.
-
assignCompoundTokens
public static void assignCompoundTokens(java.util.ArrayList<java.lang.String> scan)
Carefully interpretes the correct arrangement of a loose math statement for objects of this class and applies the correct one to the Function object.- Parameters:
scan- The ArrayList object that is the scanner of the Function object and so contains this MUnaryPostOperator object
-
-