Package org.djunits.formatter
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
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classVectorFormat.Col stores the settings that influence both the value part and the unit part of an output string when formatting a column vector.static classVectorFormat.Row stores the settings that influence both the value part and the unit part of an output string when formatting a row vector. -
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstruct a VectorFormat object with a given context. -
Method Summary
Modifier and TypeMethodDescriptionsetEndSymbol(String endSymbol) Set the end symbol to use for a vector, e.g., "]".setSeparatorSymbol(String separatorSymbol) Set the separator symbol to use for a vector, e.g., ", ".setStartSymbol(String startSymbol) Set the start symbol to use for a vector, e.g., "[".setVectorPrefix(String vectorPrefix) Set the vector prefix, e.g., "Col".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
-
VectorFormat
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
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
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
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
Set the vector prefix, e.g., "Col".- Parameters:
vectorPrefix- new vector prefix- Returns:
- VectorFormat object for fluent design
-