public class IntegerFormatter extends NumberFormatter
Integer values in a
FormattedText.NumberFormatter returns different numeric types based on the current value in the Text field. IntegerFormatter is an override of NumberFormatter allowing to guaranty to always return Integer values (Number.intValue()).
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 |
|---|
IntegerFormatter() |
IntegerFormatter(java.util.Locale loc) |
IntegerFormatter(java.lang.String editPattern) |
IntegerFormatter(java.lang.String editPattern,
java.util.Locale loc) |
IntegerFormatter(java.lang.String editPattern,
java.lang.String displayPattern) |
IntegerFormatter(java.lang.String editPattern,
java.lang.String displayPattern,
java.util.Locale loc) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getValue()
Returns the current value of the text control if it is a valid
Integer. |
java.lang.Class<java.lang.Integer> |
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 IntegerFormatter()
public IntegerFormatter(java.util.Locale loc)
public IntegerFormatter(java.lang.String editPattern,
java.util.Locale loc)
public IntegerFormatter(java.lang.String editPattern,
java.lang.String displayPattern,
java.util.Locale loc)
public IntegerFormatter(java.lang.String editPattern,
java.lang.String displayPattern)
public IntegerFormatter(java.lang.String editPattern)
public java.lang.Object getValue()
Integer.
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 NumberFormatternull elseITextFormatter.getValue()public java.lang.Class<java.lang.Integer> getValueType()
ITextFormatter handles,
i.e. returns in getValue().getValueType in interface ITextFormattergetValueType in class NumberFormatter