Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.novell.xsl.number
Class DecimalNumberFormatter

    java.lang.Object
      com.novell.xsl.number.DecimalNumberFormatter

All Implemented Interfaces:
  NumberFormatter

    public class DecimalNumberFormatter

extends Object
implements NumberFormatter

A class that formats integers into a decimal representation. This class corresponds to `xsl:number` format tokens such as `1`, `01`, etc.

Decimal number formats are characterized by their use of ten decimal digits (characters with a Unicode category of Nd) with sequential Unicode decimal digit values. In Java terms, for each of the decimal digits, `java.lang.Character.isDigit` would evaluate to `true` and `java.lang.Character.digit` would return the Unicode decimal digit value.

Constructor Summary
`DecimalNumberFormatter(char firstDigit, int minDigits)` Constructs a decimal number formatter that uses the specified characters as digits.

Method Summary
`String` | `format(int value)` Formats the specified positive integer value into a decimal number.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DecimalNumberFormatter

    public DecimalNumberFormatter(char firstDigit,
                                  int minDigits)

  Constructs a decimal number formatter that uses the specified characters as digits.

  For example, the number formatter created by `new DecimalNumberFormatter('0', 1)` corresponds to the format token `1`. It generates the sequence `1 2 3 ... 9 10 11 12 ...`.``

  Parameters:
    `firstDigit` - the first digit to be used, such as `'0'`
    `minDigits` - the minimum number of digits; formatted numbers will have extra firstDigit characters prepended if necessary
  Throws:
    `IllegalArgumentException` - if the first digit is not a Unicode decimal digit whose decimal digit value is zero (that is, `java.lang.Character.digit(`firstDigit`, 10)` is not equal to zero) or the minimum number of digits is less than zero

Method Detail

### format

    public String format(int value)
                  throws IllegalArgumentException

  Formats the specified positive integer value into a decimal number.

  Specified by:
    `format` in interface `NumberFormatter`
  Parameters:
    `value` - the value to be formatted; must be greater than zero
  Returns:
    the formatted value
  Throws:
    `IllegalArgumentException` - if the value is less than or equal to zero

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD