Class MatrixFormat


public class MatrixFormat extends Format<MatrixFormat,MatrixFormatContext>
MatrixFormat stores the settings that influence both the value part and the unit part of an output string when formatting a matrix.

Copyright (c) 2026-2026 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djunits.org. The DJUNITS project is distributed under a three-clause BSD-style license.

Author:
Alexander Verbraeck
  • Constructor Details

    • MatrixFormat

      protected MatrixFormat(MatrixFormatContext ctx)
      Construct a MatrixFormat object with a given context. Note that the context can be an existing context that is being modified or a default context.
      Parameters:
      ctx - the matrix format context to use
  • Method Details

    • defaults

      public static MatrixFormat defaults()
      Return an instance of MatrixFormat, initialized with the default values.
      Returns:
      an instance of MatrixFormat, initialized with the default values
    • changeDefaults

      public static MatrixFormat changeDefaults()
      Return an instance of MatrixFormat with the DEFAULT values, which can be changed for all subsequent calls.
      Returns:
      an instance of MatrixFormat with the DEFAULT values
    • resetDefaults

      public static void resetDefaults()
      Reset the default values of MatrixFormat to their original values.
    • setMiddleRowStartSymbol

      public MatrixFormat setMiddleRowStartSymbol(String startSymbol)
      Set the start symbol to use for a middle row in a matrix, e.g., "|".
      Parameters:
      startSymbol - new startSymbol for a matrix
      Returns:
      MatrixFormat object for fluent design
    • setMiddleRowEndSymbol

      public MatrixFormat setMiddleRowEndSymbol(String endSymbol)
      Set the end symbol for a middle row for a matrix, e.g., "]".
      Parameters:
      endSymbol - new endSymbol for a matrix
      Returns:
      MatrixFormat object for fluent design
    • setFirstRowStartSymbol

      public MatrixFormat setFirstRowStartSymbol(String startSymbol)
      Set the start symbol to use for the first row for a matrix, e.g., "|".
      Parameters:
      startSymbol - new start symbol for the first row in a matrix
      Returns:
      MatrixFormat object for fluent design
    • setFirstRowEndSymbol

      public MatrixFormat setFirstRowEndSymbol(String endSymbol)
      Set the end symbol to use for the first row for a matrix, e.g., "|".
      Parameters:
      endSymbol - new end symbol for the first row in a matrix
      Returns:
      MatrixFormat object for fluent design
    • setLastRowStartSymbol

      public MatrixFormat setLastRowStartSymbol(String startSymbol)
      Set the start symbol to use for the last row for a matrix, e.g., "|".
      Parameters:
      startSymbol - new start symbol for the last row in a matrix
      Returns:
      MatrixFormat object for fluent design
    • setLastRowEndSymbol

      public MatrixFormat setLastRowEndSymbol(String endSymbol)
      Set the end symbol to use for the last row for a matrix, e.g., "|".
      Parameters:
      endSymbol - new end symbol for the last row in a matrix
      Returns:
      MatrixFormat object for fluent design
    • setColSeparatorSymbol

      public MatrixFormat setColSeparatorSymbol(String separatorSymbol)
      Set the separator symbol to use between columns in a row for a matrix, e.g., " ".
      Parameters:
      separatorSymbol - new separatorSymbol for a matrix
      Returns:
      MatrixFormat object for fluent design
    • setMatrixPrefix

      public MatrixFormat setMatrixPrefix(String matrixPrefix)
      Set the matrix prefix, e.g., "Matrix\n".
      Parameters:
      matrixPrefix - new table prefix
      Returns:
      MatrixFormat object for fluent design
    • setMatrixPostfix

      public MatrixFormat setMatrixPostfix(String matrixPostfix)
      Set the matrix postfix, e.g., "".
      Parameters:
      matrixPostfix - new table postfix
      Returns:
      MatrixFormat object for fluent design