Class VectorFormat<F extends VectorFormat<F>>

java.lang.Object
org.djunits.formatter.Format<F,VectorFormatContext>
org.djunits.formatter.VectorFormat<F>
Type Parameters:
F - the vector format type, Row or Col
Direct Known Subclasses:
VectorFormat.Col, VectorFormat.Row

public abstract class VectorFormat<F extends VectorFormat<F>> extends Format<F,VectorFormatContext>
VectorFormat stores the settings that influence both the value part and the unit part of an output string when formatting a row or column vector. The inner subclasses VectorFormat.Col and VectorFormat.Row take care of the formatting of column vectors and row vectors specifically.

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

    • VectorFormat

      protected VectorFormat(VectorFormatContext ctx)
      Construct a VectorFormat 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 vector format context to use
  • Method Details

    • setStartSymbol

      public F setStartSymbol(String startSymbol)
      Set the start symbol to use for a vector, e.g., "[".
      Parameters:
      startSymbol - new startSymbol for a vector
      Returns:
      VectorFormat object for fluent design
    • setEndSymbol

      public F setEndSymbol(String endSymbol)
      Set the end symbol to use for a vector, e.g., "]".
      Parameters:
      endSymbol - new endSymbol for a vector
      Returns:
      VectorFormat object for fluent design
    • setSeparatorSymbol

      public F setSeparatorSymbol(String separatorSymbol)
      Set the separator symbol to use for a vector, e.g., ", ".
      Parameters:
      separatorSymbol - new separatorSymbol for a vector
      Returns:
      VectorFormat object for fluent design
    • setVectorPrefix

      public F setVectorPrefix(String vectorPrefix)
      Set the vector prefix, e.g., "Col".
      Parameters:
      vectorPrefix - new vector prefix
      Returns:
      VectorFormat object for fluent design