public class ShortFormatter extends NumberFormatter
Short values in a FormattedText.
ShortFormatter returns different numeric types based on the current
value in the Text field. ShortFormatter is an override of NumberFormatter
allowing to guaranty to always return Short values (Number.shortValue()).
alwaysShowDec, cachedPatterns, decimalLen, editPattern, editValue, fixedDec, fixedInt, groupLen, intCount, intLen, locale, minus, modified, nbspSeparator, negative, nfDisplay, nfEdit, prefixLen, suffixLen, symbols, value, zeroDecimalLen, zeroIntLenEMPTY, ignore, SPACE, text| Constructor and Description |
|---|
ShortFormatter()
Constructs a new instance with all defaults.
|
ShortFormatter(java.util.Locale loc)
Constructs a new instance with default edit and display masks for the given
locale.
|
ShortFormatter(java.lang.String editPattern)
Constructs a new instance with the given edit mask.
|
ShortFormatter(java.lang.String editPattern,
java.util.Locale loc)
Constructs a new instance with the given edit mask and locale.
|
ShortFormatter(java.lang.String editPattern,
java.lang.String displayPattern)
Constructs a new instance with the given edit and display masks.
|
ShortFormatter(java.lang.String editPattern,
java.lang.String displayPattern,
java.util.Locale loc)
Constructs a new instance with the given masks and locale.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getValue()
Returns the current value of the text control if it is a valid
Short. |
java.lang.Class<java.lang.Short> |
getValueType()
Returns the type of value this
ITextFormatter handles,
i.e. |
clearText, format, getDefaultPattern, getDisplayString, getEditString, isEmpty, isValid, setDecimalSeparatorAlwaysShown, setFixedLengths, setPatterns, setPrefix, setSuffix, setValue, verifyTextbeep, detach, setIgnore, setText, updateText, updateTextpublic ShortFormatter()
NumberFormatter.NumberFormatter()public ShortFormatter(java.util.Locale loc)
loc - the localepublic ShortFormatter(java.lang.String editPattern,
java.util.Locale loc)
editPattern - the edit maskloc - the localepublic ShortFormatter(java.lang.String editPattern,
java.lang.String displayPattern,
java.util.Locale loc)
editPattern - the edit maskdisplayPattern - the display maskloc - the localepublic ShortFormatter(java.lang.String editPattern,
java.lang.String displayPattern)
editPattern - the edit maskdisplayPattern - the display maskpublic ShortFormatter(java.lang.String editPattern)
editPattern - the edit maskpublic java.lang.Object getValue()
Short.
If the buffer is flagged as modified, the value is recalculated by parsing
with the nfEdit initialized with the edit pattern. If the
number is not valid, returns null.getValue in interface ITextFormattergetValue in class NumberFormatterShort value if valid, else nullITextFormatter.getValue()public java.lang.Class<java.lang.Short> getValueType()
ITextFormatter handles,
i.e. returns in getValue().getValueType in interface ITextFormattergetValueType in class NumberFormatter