The prefix and suffix "{" and "}" can be replaced by any user-defined strings. The number format for components can be configured.
White space is ignored at parse time, even if it is in the prefix, suffix or separator specifications. So even if the default separator does include a space character that is used at format time, both input string "{1}" and " { 1 } " will be parsed without error and the same vector will be returned. In the second case, however, the parse position after parsing will be just after the closing curly brace, i.e. just before the trailing space.
Note
using "," as a separator may interfere with the grouping separator
of the default NumberFormat for the current locale. Thus it is advised
to use a NumberFormat instance with disabled grouping in such a case.
| Access | Constructor and Description |
|---|---|
| public | |
| public | Vector1DFormat(final NumberFormat
the custom format for components. format)Create an instance with a custom number format for components. |
| public | Vector1DFormat(final String
prefix to use instead of the default "{" prefix, final String suffix to use instead of the default "}" suffix)Create an instance with custom prefix, suffix and separator. |
| public | Vector1DFormat(final String
prefix to use instead of the default "{" prefix, final String suffix to use instead of the default "}" suffix, final NumberFormat the custom format for components. format)Create an instance with custom prefix, suffix, separator and format for components. |
| Modifier and Type | Method and Description |
|---|---|
| public StringBuffer | format(final Vector<Euclidean1D>
the object to format. vector, final StringBuffer where the text is to be appended toAppendTo, final FieldPosition On input: an alignment field, if desired. On output: the
offsets of the alignment field pos)Implements abstract org. Formats a |
| public static Vector1DFormat | Returns: the default 1D vector format.Returns the default 1D vector format for the current locale. |
| public static Vector1DFormat | Returns: the 1D vector format specific to the given locale.the specific locale used by the format. locale)Returns the default 1D vector format for the given locale. |
| public Vector1D | parse(final String
the string to parse source)Implements abstract org. Parses a string to produce a |
| public Vector1D | parse(final String
the string to parse source, final ParsePosition input/output parsing parameter. pos)Implements abstract org. Parses a string to produce a |
| Vector1DFormat | back to summary |
|---|---|
| public Vector1DFormat() Create an instance with default settings. The instance uses the default prefix, suffix and separator: "{", "}", and "; " and the default number format for components. | |
| Vector1DFormat | back to summary |
|---|---|
| public Vector1DFormat(final NumberFormat format) Create an instance with a custom number format for components.
| |
| Vector1DFormat | back to summary |
|---|---|
| public Vector1DFormat(final String prefix, final String suffix) Create an instance with custom prefix, suffix and separator. | |
| Vector1DFormat | back to summary |
|---|---|
| public Vector1DFormat(final String prefix, final String suffix, final NumberFormat format) Create an instance with custom prefix, suffix, separator and format for components.
| |
| format | back to summary |
|---|---|
| public StringBuffer format(final Vector<Euclidean1D> vector, final StringBuffer toAppendTo, final FieldPosition pos) Implements abstract org. Doc from org. Formats a
| |
| getInstance | back to summary |
|---|---|
| public static Vector1DFormat getInstance() Returns the default 1D vector format for the current locale.
| |
| getInstance | back to summary |
|---|---|
| public static Vector1DFormat getInstance(final Locale locale) Returns the default 1D vector format for the given locale.
| |
| parse | back to summary |
|---|---|
| public Vector1D parse(final String source) throws MathParseException Implements abstract org. Doc from org. Parses a string to produce a
| |
| parse | back to summary |
|---|---|
| public Vector1D parse(final String source, final ParsePosition pos) Implements abstract org. Doc from org. Parses a string to produce a
| |