Class TableFormat


public class TableFormat extends Format<TableFormat,TableFormatContext>
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
  • Constructor Details

    • TableFormat

      protected TableFormat(TableFormatContext ctx)
      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

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

      public static TableFormat 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

      public TableFormat setMiddleRowStartSymbol(String startSymbol)
      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

      public TableFormat setMiddleRowEndSymbol(String endSymbol)
      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

      public TableFormat setFirstRowStartSymbol(String startSymbol)
      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

      public TableFormat setFirstRowEndSymbol(String endSymbol)
      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

      public TableFormat setLastRowStartSymbol(String startSymbol)
      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

      public TableFormat setLastRowEndSymbol(String endSymbol)
      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

      public TableFormat setColSeparatorSymbol(String separatorSymbol)
      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

      public TableFormat setTablePrefix(String tablePrefix)
      Set the table prefix, e.g., "Table\n".
      Parameters:
      tablePrefix - new table prefix
      Returns:
      TableFormat object for fluent design
    • setTablePostfix

      public TableFormat setTablePostfix(String tablePostfix)
      Set the table postfix, e.g., "".
      Parameters:
      tablePostfix - new table postfix
      Returns:
      TableFormat object for fluent design