Class MatrixBinaryOperator

java.lang.Object
parser.Operator
math.matrix.expressParser.MOperator
math.matrix.expressParser.MatrixBinaryOperator
All Implemented Interfaces:
Validatable
Direct Known Subclasses:
MmultiplicationOperator, MSubtractionOperator

public class MatrixBinaryOperator extends MOperator implements Validatable
  • Field Details

    • precedence

      private final Precedence precedence
      The precedence of this MBinaryOperator object.
    • index

      private int index
      The index of this operator in the scanned Function that it belongs to.
  • Constructor Details

    • MatrixBinaryOperator

      public MatrixBinaryOperator(String name, int index, ArrayList<String> scan)
      Parameters:
      name - the name that identifies the MBinaryOperator object
      index - The index of this operator in the scanned Function that it belongs to.
      scan - the scanner tokens MBinaryOperator object belongs to.
  • Method Details

    • getPrecedence

      public Precedence getPrecedence()
      Returns:
      the precedence of this operator
    • setIndex

      public void setIndex(int index, ArrayList<String> scan)
      Parameters:
      index - sets the index of this operator in the scanned Function that it belongs to.
      scan - The scanner output
    • getIndex

      public int getIndex()
      Returns:
      the index of this operator in the scanned Function that it belongs to.
    • validate

      public boolean validate(ArrayList<String> scan)
      Specified by:
      validate in interface Validatable
      Parameters:
      scan - the scanner output 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.