public class DecimalFormatNumberMatcher extends java.lang.Object implements NumberMatcher
NumberMatcher that uses a standard Java DecimalFormat to
match numbers.
By default, this uses the default DecimalFormat with the platform default Locale.
You will probably want your DecimalFormat to have grouping turned off, otherwise
something like 1,2 (in UK locale) would be parsed as a number 12.
| 构造器和说明 |
|---|
DecimalFormatNumberMatcher() |
DecimalFormatNumberMatcher(java.text.DecimalFormat decimalFormat) |
DecimalFormatNumberMatcher(java.util.Locale locale) |
| 限定符和类型 | 方法和说明 |
|---|---|
java.text.DecimalFormat |
getDecimalFormat() |
int |
getNumberEnd(InputContext input,
int startIndex)
Implementations should analyse the given
InputContext starting at the given
index to see if it looks like an (unsigned) number. |
void |
setDecimalFormat(java.text.DecimalFormat decimalFormat) |
public DecimalFormatNumberMatcher()
public DecimalFormatNumberMatcher(java.util.Locale locale)
public DecimalFormatNumberMatcher(java.text.DecimalFormat decimalFormat)
public java.text.DecimalFormat getDecimalFormat()
public void setDecimalFormat(java.text.DecimalFormat decimalFormat)
public int getNumberEnd(InputContext input, int startIndex)
NumberMatcherInputContext starting at the given
index to see if it looks like an (unsigned) number. If it is a number, return the
index of the next non-number character. Otherwise, return -1.getNumberEnd 在接口中 NumberMatcher