Class 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.String getName()  
      static Precedence getPrecedence​(java.lang.String name)
      The precedence of the operators
      static boolean isAssignmentOperator​(java.lang.String op)  
      static boolean isBinaryOperator​(java.lang.String op)  
      static boolean isBracket​(java.lang.String op)  
      static boolean isClosingBrace​(java.lang.String op)  
      static boolean isClosingBracket​(java.lang.String op)  
      static boolean isColJoin​(java.lang.String op)  
      boolean isColon​(java.lang.String op)  
      static boolean isCube​(java.lang.String op)  
      static boolean isDet​(java.lang.String op)  
      static boolean isDetHalfSymbol​(java.lang.String op)  
      static boolean isInverse​(java.lang.String op)  
      static boolean isMul​(java.lang.String op)  
      static boolean isOpeningBrace​(java.lang.String op)  
      static boolean isOpeningBracket​(java.lang.String op)  
      static boolean isOperatorString​(java.lang.String op)  
      static boolean isPlusOrMinus​(java.lang.String op)  
      static boolean isPower​(java.lang.String op)  
      static boolean isRowJoin​(java.lang.String op)  
      static boolean isSquare​(java.lang.String op)  
      static boolean isTri​(java.lang.String op)  
      static boolean isUnaryPostOperator​(java.lang.String op)  
      static boolean isUnaryPreOperator​(java.lang.String op)  
      static boolean isUnit​(java.lang.String op)  
      static void orderCompoundTokens​(MathExpression function)  
      void setName​(java.lang.String name)  
      static boolean validateAll​(java.util.ArrayList<java.lang.String> scan)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MatrixOperator

        public MatrixOperator​(java.lang.String name)
        Parameters:
        name - creates a new form of a valid mathronian MOperator
    • Method Detail

      • 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

        public static Precedence getPrecedence​(java.lang.String name)
        The precedence of the operators
        Parameters:
        name - the name of the MOperator object
        Returns:
        the MOperator's Precedence attribute
      • orderCompoundTokens

        public static void orderCompoundTokens​(MathExpression function)
      • validateAll

        public static boolean validateAll​(java.util.ArrayList<java.lang.String> scan)
        Parameters:
        scan - An ArrayList object containing a scanned function.