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

    • instance

      public static MatrixFormat instance()
      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.
    • setMiddleRowStart

      public MatrixFormat setMiddleRowStart(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
    • setMiddleRowEnd

      public MatrixFormat setMiddleRowEnd(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
    • setFirstRowStart

      public MatrixFormat setFirstRowStart(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
    • setFirstRowEnd

      public MatrixFormat setFirstRowEnd(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
    • setLastRowStart

      public MatrixFormat setLastRowStart(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
    • setLastRowEnd

      public MatrixFormat setLastRowEnd(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
    • setColSeparator

      public MatrixFormat setColSeparator(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