net.sf.saxon.number
Class NumberFormatter
java.lang.Object
net.sf.saxon.number.NumberFormatter
- Serializable
public class NumberFormatter
extends java.lang.Object
implements Serializable
Class NumberFormatter defines a method to format a ArrayList of integers as a character
string according to a supplied format specification.
CharSequence | format(List numbers, int groupSize, String groupSeparator, String letterValue, String ordinal, Numberer numberer) - Format a list of numbers.
|
static int | getDigitValue(int in) - Determine whether a character represents a digit and if so, which digit.
|
void | prepare(String format) - Tokenize the format pattern.
|
isLetterOrDigitMethod
public static Method isLetterOrDigitMethod
methodInitialized
public static boolean methodInitialized
format
public CharSequence format(List numbers,
int groupSize,
String groupSeparator,
String letterValue,
String ordinal,
Numberer numberer)
Format a list of numbers.
numbers
- the numbers to be formatted (a sequence of integer values; it may also contain
preformatted strings as part of the error recovery fallback)
- the formatted output string.
getDigitValue
public static int getDigitValue(int in)
Determine whether a character represents a digit and if so, which digit.
in
- the Unicode character being tested. It's known that this is alphanumeric.
- -1 if it's not a digit, otherwise the digit value.
prepare
public void prepare(String format)
Tokenize the format pattern.
format
- the format specification. Contains one of the following values:- "1": conventional decimal numbering
- "a": sequence a, b, c, ... aa, ab, ac, ...
- "A": sequence A, B, C, ... AA, AB, AC, ...
- "i": sequence i, ii, iii, iv, v ...
- "I": sequence I, II, III, IV, V, ...
This symbol may be preceded and followed by punctuation (any other characters) which is
copied to the output string.