public class LongFormatter extends NumberFormatter
Long
values in a
FormattedText
.NumberFormatter returns different numeric types based on the current value in the Text field. LongFormatter is an override of NumberFormatter allowing to guaranty to always return Long values (Number.longValue()).
alwaysShowDec, cachedPatterns, decimalLen, editPattern, editValue, fixedDec, fixedInt, groupLen, intCount, intLen, locale, minus, modified, nbspSeparator, negative, nfDisplay, nfEdit, prefixLen, suffixLen, symbols, value, zeroDecimalLen, zeroIntLen
EMPTY, ignore, SPACE, text
Constructor and Description |
---|
LongFormatter() |
LongFormatter(java.util.Locale loc) |
LongFormatter(java.lang.String editPattern) |
LongFormatter(java.lang.String editPattern,
java.util.Locale loc) |
LongFormatter(java.lang.String editPattern,
java.lang.String displayPattern) |
LongFormatter(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
Long . |
java.lang.Class<java.lang.Long> |
getValueType()
Returns the type of value this
ITextFormatter handles,
i.e. |
clearText, format, getDefaultPattern, getDisplayString, getEditString, isEmpty, isValid, setDecimalSeparatorAlwaysShown, setFixedLengths, setPatterns, setPrefix, setSuffix, setValue, verifyText
beep, detach, setIgnore, setText, updateText, updateText
public LongFormatter()
public LongFormatter(java.util.Locale loc)
public LongFormatter(java.lang.String editPattern, java.util.Locale loc)
public LongFormatter(java.lang.String editPattern, java.lang.String displayPattern, java.util.Locale loc)
public LongFormatter(java.lang.String editPattern, java.lang.String displayPattern)
public LongFormatter(java.lang.String editPattern)
public java.lang.Object getValue()
Long
.
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 ITextFormatter
getValue
in class NumberFormatter
null
elseITextFormatter.getValue()
public java.lang.Class<java.lang.Long> getValueType()
ITextFormatter
handles,
i.e. returns in getValue()
.getValueType
in interface ITextFormatter
getValueType
in class NumberFormatter