Class MOperator

java.lang.Object
parser.Operator
math.matrix.expressParser.MOperator
Direct Known Subclasses:
MatrixBinaryOperator, MBinaryOperator, MBracket, MUnaryPostOperator

public class MOperator extends Operator
  • Field Details

  • Constructor Details

    • MOperator

      public MOperator(String name)
      Parameters:
      name - creates a new form of a valid MOperator
  • Method Details

    • setName

      public void setName(String name)
      Overrides:
      setName in class Operator
      Parameters:
      name - set the name of the MOperator object
    • getName

      public String getName()
      Overrides:
      getName in class Operator
      Returns:
      the name of the MOperator object
    • isOperatorString

      public static boolean isOperatorString(String op)
      Parameters:
      op - The string to check.
      Returns:
      true if the operator is a valid mathronian operator
    • isRowJoin

      public static boolean isRowJoin(String op)
      Parameters:
      op - the String object in consideration
      Returns:
      true if the String object contains a exit command
    • isColJoin

      public static boolean isColJoin(String op)
      Parameters:
      op - the String object in consideration
      Returns:
      true if the String object contains a exit command
    • isColon

      public static boolean isColon(String op)
    • isTri

      public static boolean isTri(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(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(String op)
      Parameters:
      op - the String object in consideration
      Returns:
      true if the String object represents a [ character
    • isClosingBrace

      public static boolean isClosingBrace(String op)
      Parameters:
      op - the String object in consideration
      Returns:
      true if the String object represents a [ character
    • isAssignmentOperator

      public static boolean isAssignmentOperator(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(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(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(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(String op)
      Parameters:
      op - the String to check
      Returns:
      true if the operator is the "%" operator
    • isBracket

      public static boolean isBracket(String op)
      Parameters:
      op - the String to check
      Returns:
      true if the operator is the "(" or the ")" operator
    • isOpeningBracket

      public static boolean isOpeningBracket(String op)
      Parameters:
      op - the String to check
      Returns:
      true if the operator is the "(" operator
    • isClosingBracket

      public static boolean isClosingBracket(String op)
      Parameters:
      op - the String to check
      Returns:
      true if the operator is the ")" operator
    • isInverse

      public static boolean isInverse(String op)
      Parameters:
      op - the String to check
      Returns:
      true if the operator is the "-¹" operator
    • isDetHalfSymbol

      public static boolean isDetHalfSymbol(String op)
      Parameters:
      op - the String to check
      Returns:
      true if the operator is the "|" operator
    • isDet

      public static boolean isDet(String op)
      Parameters:
      op - the String to check
      Returns:
      true if the operator is the "|" operator
    • isSquare

      public static boolean isSquare(String op)
      Parameters:
      op - the String to check
      Returns:
      true if the operator is the "²" operator
    • isCube

      public static boolean isCube(String op)
      Parameters:
      op - the String to check
      Returns:
      true if the operator is the "³" operator
    • isUnaryPreOperator

      public static boolean isUnaryPreOperator(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(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(String name)
      The precedence of the operators
      Parameters:
      name - the name of the MOperator object
      Returns:
      the MOperator's Precedence attribute
    • validateAll

      public static boolean validateAll(ArrayList<String> scan)
      Parameters:
      scan - An ArrayList object containing a scanned function.
      Returns:
      true if validated successfully