Package org.yamcs.studio.data.vtype
Class SimpleValueFormat
java.lang.Object
java.text.Format
org.yamcs.studio.data.vtype.ValueFormat
org.yamcs.studio.data.vtype.SimpleValueFormat
- All Implemented Interfaces:
Serializable
,Cloneable
Default implementation for formatting.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.Format
Format.Field
-
Constructor Summary
ConstructorDescriptionSimpleValueFormat
(int maxElements) Formats any scalar and array, by using the server side formatting and limiting the elements of the array displayed to maxElements. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBuffer
format
(List<String> data, StringBuffer toAppendTo, FieldPosition pos) Formats a string array.protected StringBuffer
format
(Array array, StringBuffer toAppendTo, FieldPosition pos) Formats an array.protected StringBuffer
format
(ListBoolean data, StringBuffer toAppendTo, FieldPosition pos) Formats a boolean array.protected StringBuffer
format
(Scalar scalar, StringBuffer toAppendTo, FieldPosition pos) Formats a scalar.protected StringBuffer
format
(VNumberArray array, StringBuffer toAppendTo, FieldPosition pos) Formats a numeric array.Methods inherited from class org.yamcs.studio.data.vtype.ValueFormat
format, format, format, getNumberFormat, parseByte, parseByteArray, parseDouble, parseDoubleArray, parseEnum, parseEnumArray, parseFloat, parseFloatArray, parseInt, parseIntArray, parseObject, parseObject, parseShort, parseShortArray, parseString, parseStringArray, setNumberFormat
Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
-
Constructor Details
-
SimpleValueFormat
public SimpleValueFormat(int maxElements) Formats any scalar and array, by using the server side formatting and limiting the elements of the array displayed to maxElements.- Parameters:
maxElements
- maximum number of array elements converted to string
-
-
Method Details
-
format
Description copied from class:ValueFormat
Formats a scalar.- Specified by:
format
in classValueFormat
- Parameters:
scalar
- data object to formattoAppendTo
- output bufferpos
- the field position- Returns:
- the output buffer
-
format
Formats a numeric array. This method can be overridden to change the way numeric arrays are formatted.- Parameters:
array
- the array to formattoAppendTo
- the buffer to append topos
- the position of the field- Returns:
- the string buffer
-
format
Formats a string array. This method can be overridden to change the way string arrays are formatted.- Parameters:
data
- the data to formattoAppendTo
- the buffer to append topos
- the position of the field- Returns:
- the string buffer
-
format
Formats a boolean array. This method can be overridden to change the way string arrays are formatted.- Parameters:
data
- the data to formattoAppendTo
- the buffer to append topos
- the position of the field- Returns:
- the string buffer
-
format
Description copied from class:ValueFormat
Formats an array.- Specified by:
format
in classValueFormat
- Parameters:
array
- data object to formattoAppendTo
- output bufferpos
- the field position- Returns:
- the output buffer
-