Package org.djunits.formatter
Class TableFormat
TableFormat stores the settings that influence both the value part and the unit part of an output string when formatting a
table.
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 TableFormat object with a given context. -
Method Summary
Modifier and TypeMethodDescriptionstatic TableFormatReturn an instance of TableFormat with the DEFAULT values, which can be changed for all subsequent calls.static TableFormatdefaults()Return an instance of TableFormat, initialized with the default values.static voidReset the default values of TableFormat to their original values.setColSeparatorSymbol(String separatorSymbol) Set the separator symbol to use between columns in a row for a table, e.g., " ".setFirstRowEndSymbol(String endSymbol) Set the end symbol to use for the first row for a table, e.g., "|".setFirstRowStartSymbol(String startSymbol) Set the start symbol to use for the first row for a table, e.g., "|".setLastRowEndSymbol(String endSymbol) Set the end symbol to use for the last row for a table, e.g., "|".setLastRowStartSymbol(String startSymbol) Set the start symbol to use for the last row for a table, e.g., "|".setMiddleRowEndSymbol(String endSymbol) Set the end symbol for a middle row for a table, e.g., "]".setMiddleRowStartSymbol(String startSymbol) Set the start symbol to use for a middle row in a table, e.g., "|".setTablePostfix(String tablePostfix) Set the table postfix, e.g., "".setTablePrefix(String tablePrefix) Set the table prefix, e.g., "Table\n".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
-
TableFormat
Construct a TableFormat 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 table format context to use
-
-
Method Details
-
defaults
Return an instance of TableFormat, initialized with the default values.- Returns:
- an instance of TableFormat, initialized with the default values
-
changeDefaults
Return an instance of TableFormat with the DEFAULT values, which can be changed for all subsequent calls.- Returns:
- an instance of TableFormat with the DEFAULT values
-
resetDefaults
public static void resetDefaults()Reset the default values of TableFormat to their original values. -
setMiddleRowStartSymbol
Set the start symbol to use for a middle row in a table, e.g., "|".- Parameters:
startSymbol- new startSymbol for a table- Returns:
- TableFormat object for fluent design
-
setMiddleRowEndSymbol
Set the end symbol for a middle row for a table, e.g., "]".- Parameters:
endSymbol- new endSymbol for a table- Returns:
- TableFormat object for fluent design
-
setFirstRowStartSymbol
Set the start symbol to use for the first row for a table, e.g., "|".- Parameters:
startSymbol- new start symbol for the first row in a table- Returns:
- TableFormat object for fluent design
-
setFirstRowEndSymbol
Set the end symbol to use for the first row for a table, e.g., "|".- Parameters:
endSymbol- new end symbol for the first row in a table- Returns:
- TableFormat object for fluent design
-
setLastRowStartSymbol
Set the start symbol to use for the last row for a table, e.g., "|".- Parameters:
startSymbol- new start symbol for the last row in a table- Returns:
- TableFormat object for fluent design
-
setLastRowEndSymbol
Set the end symbol to use for the last row for a table, e.g., "|".- Parameters:
endSymbol- new end symbol for the last row in a table- Returns:
- TableFormat object for fluent design
-
setColSeparatorSymbol
Set the separator symbol to use between columns in a row for a table, e.g., " ".- Parameters:
separatorSymbol- new separatorSymbol for a table- Returns:
- TableFormat object for fluent design
-
setTablePrefix
Set the table prefix, e.g., "Table\n".- Parameters:
tablePrefix- new table prefix- Returns:
- TableFormat object for fluent design
-
setTablePostfix
Set the table postfix, e.g., "".- Parameters:
tablePostfix- new table postfix- Returns:
- TableFormat object for fluent design
-