The prefix and suffix "{" and "}" and the separator "; " 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;1;1}" and " { 1 ; 1 ; 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 | Vector3DFormat(final NumberFormat
the custom format for components. format)Create an instance with a custom number format for components. |
| public | Vector3DFormat(final String
prefix to use instead of the default "{" prefix, final String suffix to use instead of the default "}" suffix, final String separator to use instead of the default "; " separator)Create an instance with custom prefix, suffix and separator. |
| public | Vector3DFormat(final String
prefix to use instead of the default "{" prefix, final String suffix to use instead of the default "}" suffix, final String separator to use instead of the default "; " separator, 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 | Returns: the value passed in as toAppendTo.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 Vector3DFormat | Returns: the default 3D vector format.Returns the default 3D vector format for the current locale. |
| public static Vector3DFormat | Returns: the 3D vector format specific to the given locale.the specific locale used by the format. locale)Returns the default 3D vector format for the given locale. |
| public Vector3D | Returns: the parsedVector3D object.the string to parse source)Implements abstract org. Parses a string to produce a |
| public Vector3D | Returns: the parsedVector3D object.the string to parse source, final ParsePosition input/ouput parsing parameter. pos)Implements abstract org. Parses a string to produce a |
| Vector3DFormat | back to summary |
|---|---|
| public Vector3DFormat() Create an instance with default settings. The instance uses the default prefix, suffix and separator: "{", "}", and "; " and the default number format for components. | |
| Vector3DFormat | back to summary |
|---|---|
| public Vector3DFormat(final NumberFormat format) Create an instance with a custom number format for components.
| |
| Vector3DFormat | back to summary |
|---|---|
| public Vector3DFormat(final String prefix, final String suffix, final String separator) Create an instance with custom prefix, suffix and separator. | |
| Vector3DFormat | back to summary |
|---|---|
| public Vector3DFormat(final String prefix, final String suffix, final String separator, final NumberFormat format) Create an instance with custom prefix, suffix, separator and format for components.
| |
| format | back to summary |
|---|---|
| public StringBuffer format(final Vector<Euclidean3D> vector, final StringBuffer toAppendTo, final FieldPosition pos) Implements abstract org. Formats a
| |
| getInstance | back to summary |
|---|---|
| public static Vector3DFormat getInstance() Returns the default 3D vector format for the current locale.
| |
| getInstance | back to summary |
|---|---|
| public static Vector3DFormat getInstance(final Locale locale) Returns the default 3D vector format for the given locale.
| |
| parse | back to summary |
|---|---|
| public Vector3D parse(final String source) throws MathParseException Implements abstract org. Parses a string to produce a
| |
| parse | back to summary |
|---|---|
| public Vector3D parse(final String source, final ParsePosition pos) Implements abstract org. Parses a string to produce a
| |