public class FloatFormatter extends NumberFormatter
Float values in a
FormattedText.NumberFormatter returns different numeric types based on the current value in the Text field. FloatFormatter is an override of NumberFormatter allowing to guaranty to always return Float values (Number.floatValue()).
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 |
|---|
FloatFormatter() |
FloatFormatter(java.util.Locale loc) |
FloatFormatter(java.lang.String editPattern) |
FloatFormatter(java.lang.String editPattern,
java.util.Locale loc) |
FloatFormatter(java.lang.String editPattern,
java.lang.String displayPattern) |
FloatFormatter(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
Float. |
java.lang.Class<java.lang.Float> |
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 FloatFormatter()
public FloatFormatter(java.util.Locale loc)
public FloatFormatter(java.lang.String editPattern,
java.util.Locale loc)
public FloatFormatter(java.lang.String editPattern,
java.lang.String displayPattern,
java.util.Locale loc)
public FloatFormatter(java.lang.String editPattern,
java.lang.String displayPattern)
public FloatFormatter(java.lang.String editPattern)
public java.lang.Object getValue()
Float.
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.Float> getValueType()
ITextFormatter handles,
i.e. returns in getValue().getValueType in interface ITextFormattergetValueType in class NumberFormatter