Package org.djunits.formatter
Class MatrixFormat
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
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstruct a MatrixFormat object with a given context. -
Method Summary
Modifier and TypeMethodDescriptionstatic MatrixFormatReturn an instance of MatrixFormat with the DEFAULT values, which can be changed for all subsequent calls.static MatrixFormatdefaults()Return an instance of MatrixFormat, initialized with the default values.static voidReset the default values of MatrixFormat to their original values.setColSeparatorSymbol(String separatorSymbol) Set the separator symbol to use between columns in a row for a matrix, e.g., " ".setFirstRowEndSymbol(String endSymbol) Set the end symbol to use for the first row for a matrix, e.g., "|".setFirstRowStartSymbol(String startSymbol) Set the start symbol to use for the first row for a matrix, e.g., "|".setLastRowEndSymbol(String endSymbol) Set the end symbol to use for the last row for a matrix, e.g., "|".setLastRowStartSymbol(String startSymbol) Set the start symbol to use for the last row for a matrix, e.g., "|".setMatrixPostfix(String matrixPostfix) Set the matrix postfix, e.g., "".setMatrixPrefix(String matrixPrefix) Set the matrix prefix, e.g., "Matrix\n".setMiddleRowEndSymbol(String endSymbol) Set the end symbol for a middle row for a matrix, e.g., "]".setMiddleRowStartSymbol(String startSymbol) Set the start symbol to use for a middle row in a matrix, e.g., "|".Methods inherited from class org.djunits.formatter.Format
self, setDecimals, setDisplay, setDisplayUnit, setDisplayUnit, setDivider, setDotSeparator, setEngineering, setFixedFloat, setFixedWithEngFallback, setFixedWithSciFallback, setFormatString, setGroupingSeparator, setLocale, setNoReference, setPowerPostfix, setPowerPrefix, setPrintReference, setPrintReference, setReferencePostfix, setReferencePrefix, setScientific, setSiUnits, setTextual, setTextual, setUnitPostfix, setUnitPrefix, setUpperE, setVariableLength, setWidth
-
Constructor Details
-
MatrixFormat
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
Return an instance of MatrixFormat, initialized with the default values.- Returns:
- an instance of MatrixFormat, initialized with the default values
-
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
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
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
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
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
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
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
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
Set the matrix prefix, e.g., "Matrix\n".- Parameters:
matrixPrefix- new table prefix- Returns:
- MatrixFormat object for fluent design
-
setMatrixPostfix
Set the matrix postfix, e.g., "".- Parameters:
matrixPostfix- new table postfix- Returns:
- MatrixFormat object for fluent design
-