Package math.matrix.expressParser
Class MatrixOperator
java.lang.Object
math.matrix.expressParser.MatrixOperator
- Direct Known Subclasses:
HalfDet
public class MatrixOperator
extends java.lang.Object
- Author:
- GBENRO
-
Constructor Summary
Constructors Constructor Description MatrixOperator(java.lang.String name) -
Method Summary
Modifier and Type Method Description java.lang.StringgetName()static PrecedencegetPrecedence(java.lang.String name)The precedence of the operatorsstatic booleanisAssignmentOperator(java.lang.String op)static booleanisBinaryOperator(java.lang.String op)static booleanisBracket(java.lang.String op)static booleanisClosingBrace(java.lang.String op)static booleanisClosingBracket(java.lang.String op)static booleanisColJoin(java.lang.String op)booleanisColon(java.lang.String op)static booleanisCube(java.lang.String op)static booleanisDet(java.lang.String op)static booleanisDetHalfSymbol(java.lang.String op)static booleanisInverse(java.lang.String op)static booleanisMul(java.lang.String op)static booleanisOpeningBrace(java.lang.String op)static booleanisOpeningBracket(java.lang.String op)static booleanisOperatorString(java.lang.String op)static booleanisPlusOrMinus(java.lang.String op)static booleanisPower(java.lang.String op)static booleanisRowJoin(java.lang.String op)static booleanisSquare(java.lang.String op)static booleanisTri(java.lang.String op)static booleanisUnaryPostOperator(java.lang.String op)static booleanisUnaryPreOperator(java.lang.String op)static booleanisUnit(java.lang.String op)static voidorderCompoundTokens(MathExpression function)voidsetName(java.lang.String name)static booleanvalidateAll(java.util.ArrayList<java.lang.String> scan)
-
Constructor Details
-
MatrixOperator
public MatrixOperator(java.lang.String name)- Parameters:
name- creates a new form of a valid mathronian MOperator
-
-
Method Details
-
setName
public void setName(java.lang.String name)- Parameters:
name- set the name of the MOperator object
-
getName
public java.lang.String getName()- Returns:
- the name of the MOperator object
-
isOperatorString
public static boolean isOperatorString(java.lang.String op)- Parameters:
op- The string to check.- Returns:
- true if the operator is a valid mathronian operator
-
isRowJoin
public static boolean isRowJoin(java.lang.String op)- Parameters:
op- the String object in consideration- Returns:
- true if the String object contains a exit command
-
isColJoin
public static boolean isColJoin(java.lang.String op)- Parameters:
op- the String object in consideration- Returns:
- true if the String object contains a exit command
-
isColon
public boolean isColon(java.lang.String op) -
isTri
public static boolean isTri(java.lang.String op)- Parameters:
op- the String object in consideration- Returns:
- true if the String object contains a Variable storage command
-
isUnit
public static boolean isUnit(java.lang.String op)- Parameters:
op- the String object in consideration- Returns:
- true if the String object contains a constant storage command
-
isOpeningBrace
public static boolean isOpeningBrace(java.lang.String op)- Parameters:
op- the String object in consideration- Returns:
- true if the String object represents a [ character
-
isClosingBrace
public static boolean isClosingBrace(java.lang.String op)- Parameters:
op- the String object in consideration- Returns:
- true if the String object represents a [ character
-
isAssignmentOperator
public static boolean isAssignmentOperator(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the "=" operator it means that we assign or store the value of the RHS in the LHS and so the LHS must represent a valid variable
-
isBinaryOperator
public static boolean isBinaryOperator(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is an operator that functions in between 2 numbers or variables i.e,+,-,*,/,^,%,Č,Р
-
isPlusOrMinus
public static boolean isPlusOrMinus(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the + operator or is the - operator the form is log-¹(num,base)
-
isMul
public static boolean isMul(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the * operator the form is log-¹(num,base)
-
isPower
public static boolean isPower(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the "%" operator
-
isBracket
public static boolean isBracket(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the "(" or the ")" operator
-
isOpeningBracket
public static boolean isOpeningBracket(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the "(" operator
-
isClosingBracket
public static boolean isClosingBracket(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the ")" operator
-
isInverse
public static boolean isInverse(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the "-¹" operator
-
isDetHalfSymbol
public static boolean isDetHalfSymbol(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the "|" operator
-
isDet
public static boolean isDet(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the "|" operator
-
isSquare
public static boolean isSquare(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the "²" operator
-
isCube
public static boolean isCube(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is the "³" operator
-
isUnaryPreOperator
public static boolean isUnaryPreOperator(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is a pre-number operator e.g the trig operators,exponential operators,logarithmic operators(not to any base)
-
isUnaryPostOperator
public static boolean isUnaryPostOperator(java.lang.String op)- Parameters:
op- the String to check- Returns:
- true if the operator is a post number operator e.g the inverse operator,the factorial,the square and the cube
-
getPrecedence
The precedence of the operators- Parameters:
name- the name of the MOperator object- Returns:
- the MOperator's Precedence attribute
-
orderCompoundTokens
-
validateAll
public static boolean validateAll(java.util.ArrayList<java.lang.String> scan)- Parameters:
scan- An ArrayList object containing a scanned function.
-