本文整理汇总了Java中gnu.text.EnglishIntegerFormat类的典型用法代码示例。如果您正苦于以下问题:Java EnglishIntegerFormat类的具体用法?Java EnglishIntegerFormat怎么用?Java EnglishIntegerFormat使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EnglishIntegerFormat类属于gnu.text包,在下文中一共展示了EnglishIntegerFormat类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInstance
import gnu.text.EnglishIntegerFormat; //导入依赖的package包/类
public static java.text.Format
getInstance (int base, int minWidth, int padChar,
int commaChar, int commaInterval, int flags)
{
if (base == PARAM_UNSPECIFIED)
{
if (padChar == PARAM_UNSPECIFIED
&& padChar == PARAM_UNSPECIFIED
&& commaChar == PARAM_UNSPECIFIED
&& commaInterval == PARAM_UNSPECIFIED)
{
// Common Lisp ~R format:
boolean seenColon = (flags&SHOW_GROUPS) != 0;
if ((flags & SHOW_PLUS) != 0)
return RomanIntegerFormat.getInstance(seenColon);
else
return EnglishIntegerFormat.getInstance(seenColon);
}
base = 10;
}
if (minWidth == PARAM_UNSPECIFIED) minWidth = 1;
if (padChar == PARAM_UNSPECIFIED) padChar = ' ';
if (commaChar == PARAM_UNSPECIFIED) commaChar = ',';
if (commaInterval == PARAM_UNSPECIFIED) commaInterval = 3;
if (base == 10 && minWidth == 1 && padChar == ' '
&& commaChar == ',' && commaInterval == 3
&& flags == 0)
return getInstance();
IntegerFormat fmt = new IntegerFormat();
fmt.base = base;
fmt.minWidth = minWidth;
fmt.padChar = padChar;
fmt.commaChar = commaChar;
fmt.commaInterval = commaInterval;
fmt.flags = flags;
return fmt;
}