Class MatrixValueParser

java.lang.Object
math.matrix.expressParser.MatrixValueParser

public class MatrixValueParser
extends java.lang.Object
Objects of this class extract a matrix from an input expression of the format: [num1,num2,...:num_i,num_i+1,....:num_j,num_j+1...: ] e.g [2,3,4:4,1,2:...] The colons represent the end of one row of values and the beginning of another.
Author:
JIBOYE Oluwagbemiro Olaoluwa
  • Constructor Summary

    Constructors 
    Constructor Description
    MatrixValueParser()  
    MatrixValueParser​(java.lang.String values)  
  • Method Summary

    Modifier and Type Method Description
    Matrix getMatrix()  
    PrecisionMatrix getPrecisionMatrix()  
    java.util.ArrayList<java.lang.String> getScan()  
    Dimension getSize()  
    java.lang.String getValues()  
    boolean isValid()  
    void scanner()
    Scans a matrix value string into tokens, e.g [2,4,5:3,9.939,45.2:1,4,2] and produces an output containing the numbers and the colons in the ArrayList attribute scan.
    void setScan​(java.util.ArrayList<java.lang.String> scan)  
    void setValid​(boolean valid)  
    void setValues​(java.lang.String values)  

    Methods inherited from class java.lang.Object

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

    • MatrixValueParser

      public MatrixValueParser()
    • MatrixValueParser

      public MatrixValueParser​(java.lang.String values)
      Parameters:
      values - A matrix value string e.g [2,4,5:3,9.939,45.2:1,4,2:]
  • Method Details

    • scanner

      public void scanner() throws MatrixFormatException
      Scans a matrix value string into tokens, e.g [2,4,5:3,9.939,45.2:1,4,2] and produces an output containing the numbers and the colons in the ArrayList attribute scan. Method getMatrix then extracts the matrix from scan.
      Throws:
      MatrixFormatException - if the format of the input does not conform to that of a matrix.
    • setValues

      public void setValues​(java.lang.String values)
    • getValues

      public java.lang.String getValues()
    • setValid

      public void setValid​(boolean valid)
    • isValid

      public boolean isValid()
    • getSize

      public Dimension getSize()
    • setScan

      public void setScan​(java.util.ArrayList<java.lang.String> scan)
    • getScan

      public java.util.ArrayList<java.lang.String> getScan()
    • getMatrix

      public Matrix getMatrix() throws java.lang.NullPointerException
      Returns:
      a Matrix object from the scanned values.
      Throws:
      java.lang.NullPointerException
    • getPrecisionMatrix

      public PrecisionMatrix getPrecisionMatrix() throws java.lang.NullPointerException
      Returns:
      a PrecisionMatrix object from the scanned values.
      Throws:
      java.lang.NullPointerException