com.novell.xsl.number
Class AlphabeticNumberFormatter
java.lang.Object
com.novell.xsl.number.AlphabeticNumberFormatter
- All Implemented Interfaces:
- NumberFormatter
- public class AlphabeticNumberFormatter
- extends Object
- implements NumberFormatter
A class that formats integers into an alphabetic representation. This class
corresponds to the xsl:number
format tokens a
and A
, and can be used to support other alphabetic formats.
Alphabetic number formats are characterized by their ability to use "digits"
with non-sequential Unicode values and by the absence of a "digit" that
represents zero.
Method Summary |
String |
format(int value)
Formats the specified positive integer value into an alphabetic number. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AlphabeticNumberFormatter
public AlphabeticNumberFormatter(String digits)
- Constructs an alphabetic number formatter that uses the specified
characters as digits.
For example, the number formatter created by
new AlphabeticNumberFormatter("abcdefghijklmnopqrstuvwxyz")
corresponds to the format token a
. It generates the
sequence a b c ... z aa ab ac ....
- Parameters:
digits
- the characters to be used as digits
format
public String format(int value)
throws IllegalArgumentException
- Formats the specified positive integer value into an alphabetic 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