Record Class MatrixMarketHeader

java.lang.Object
java.lang.Record
org.flag4j.io.MatrixMarketHeader
Record Components:
object - The type of object the Matrix Market file contains (e.g. matrix or vector).
format - The format of the data the Matrix Market file contains (e.g. array (dense) or coordinate (sparse COO)).
field - The field the elements belong to in the Matrix Market file (e.g. real, integer, or complex).
symmetry - The symmetry of the data in the Matrix Market file (e.g. general, symmetric, skew-symmetric, Hermitian).
comments - Comments to prepend to file after the main header.

public record MatrixMarketHeader(MatrixMarketHeader.MMObject object, MatrixMarketHeader.MMFormat format, MatrixMarketHeader.MMField field, MatrixMarketHeader.MMSymmetry symmetry, String[] comments) extends Record

A data record for storing the tokens of a Matrix Market Exchange Format file header. Valid tokens for each modifier are defined by the following enums:

See Also:
  • Constructor Details

  • Method Details

    • parseHeader

      public static MatrixMarketHeader parseHeader(String header)
      Parses a string representing the header of a Matrix Market file and stores in a MatrixMarketHeader object.
      Parameters:
      header - String containing the header, and only the header, of the Matrix Market file.
      Returns:
      A MatrixMarketHeader object containing information about the Matrix Market object type, format, field type, and symmetry.
    • toString

      public String toString()
      The String representation of this Matrix Market Exchange Format header.
      Specified by:
      toString in class Record
      Returns:
      This Matrix Market Exchange Format header as a string.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • object

      public MatrixMarketHeader.MMObject object()
      Returns the value of the object record component.
      Returns:
      the value of the object record component
    • format

      public MatrixMarketHeader.MMFormat format()
      Returns the value of the format record component.
      Returns:
      the value of the format record component
    • field

      Returns the value of the field record component.
      Returns:
      the value of the field record component
    • symmetry

      public MatrixMarketHeader.MMSymmetry symmetry()
      Returns the value of the symmetry record component.
      Returns:
      the value of the symmetry record component
    • comments

      public String[] comments()
      Returns the value of the comments record component.
      Returns:
      the value of the comments record component