类 AbstractNumberFormatter
java.lang.Object
cn.taketoday.format.number.AbstractNumberFormatter
Abstract formatter for Numbers,
providing a
getNumberFormat(Locale) template method.- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Keith Donald
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected abstract NumberFormatgetNumberFormat(Locale locale) Obtain a concrete NumberFormat for the specified locale.Parse a text String to produce a T.Print the object of type T for display.voidsetLenient(boolean lenient) Specify whether or not parsing is to be lenient.
-
构造器详细资料
-
AbstractNumberFormatter
public AbstractNumberFormatter()
-
-
方法详细资料
-
setLenient
public void setLenient(boolean lenient) Specify whether or not parsing is to be lenient. Default is false.With lenient parsing, the parser may allow inputs that do not precisely match the format. With strict parsing, inputs must match the format exactly.
-
print
从接口复制的说明:PrinterPrint the object of type T for display. -
parse
从接口复制的说明:ParserParse a text String to produce a T.- 指定者:
parse在接口中Parser<Number>- 参数:
text- the text stringlocale- the current user locale- 返回:
- an instance of T
- 抛出:
ParseException- when a parse exception occurs in a java.text parsing library
-
getNumberFormat
Obtain a concrete NumberFormat for the specified locale.- 参数:
locale- the current locale- 返回:
- the NumberFormat instance (never
null)
-