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:
MatrixMarketHeader.MMObject
- Valid object types in the Matrix Market file.MatrixMarketHeader.MMFormat
- Valid formats in the Matrix Market file.MatrixMarketHeader.MMField
- Valid field types in the Matrix Market file.MatrixMarketHeader.MMSymmetry
- Valid symmetries in the Matrix Market file.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum containing valid field types in a Matrix Market file.static enum
Enum containing valid formats in a Matrix Market file.static enum
Enum containing valid object types in a Matrix Market file.static enum
Enum containing valid symmetry in a Matrix Market file. -
Constructor Summary
ConstructorsConstructorDescriptionMatrixMarketHeader
(MatrixMarketHeader.MMObject object, MatrixMarketHeader.MMFormat format, MatrixMarketHeader.MMField field, MatrixMarketHeader.MMSymmetry symmetry, String... comments) Creates an instance of aMatrixMarketHeader
record class. -
Method Summary
Modifier and TypeMethodDescriptionString[]
comments()
Returns the value of thecomments
record component.final boolean
Indicates whether some other object is "equal to" this one.field()
Returns the value of thefield
record component.format()
Returns the value of theformat
record component.final int
hashCode()
Returns a hash code value for this object.object()
Returns the value of theobject
record component.static MatrixMarketHeader
parseHeader
(String header) Parses a string representing the header of a Matrix Market file and stores in aMatrixMarketHeader
object.symmetry()
Returns the value of thesymmetry
record component.toString()
The String representation of this Matrix Market Exchange Format header.
-
Constructor Details
-
MatrixMarketHeader
public MatrixMarketHeader(MatrixMarketHeader.MMObject object, MatrixMarketHeader.MMFormat format, MatrixMarketHeader.MMField field, MatrixMarketHeader.MMSymmetry symmetry, String... comments) Creates an instance of aMatrixMarketHeader
record class.
-
-
Method Details
-
parseHeader
Parses a string representing the header of a Matrix Market file and stores in aMatrixMarketHeader
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
-
hashCode
-
equals
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 withObjects::equals(Object,Object)
. -
object
-
format
-
field
-
symmetry
-
comments
-