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