fop 2.3

org.apache.fop.complexscripts.util
Class NumberConverter

java.lang.Object
  extended by org.apache.fop.complexscripts.util.NumberConverter

public class NumberConverter
extends java.lang.Object

Implementation of Number to String Conversion algorithm specified by XSL Transformations (XSLT) Version 2.0, W3C Recommendation, 23 January 2007.

This algorithm differs from that specified in XSLT 1.0 in the following ways:

Implementation Defaults and Limitations

Implementation Notes

This work was originally authored by Glenn Adams ([email protected]).


Field Summary
static int LETTER_VALUE_ALPHABETIC
          alphabetical
static int LETTER_VALUE_TRADITIONAL
          traditional
 
Constructor Summary
NumberConverter(java.lang.String format, int groupingSeparator, int groupingSize, int letterValue, java.lang.String features, java.lang.String language, java.lang.String country)
          Construct parameterized number converter.
 
Method Summary
 java.lang.String convert(java.util.List<java.lang.Long> numbers)
          Convert list of numbers to string according to conversion parameters.
 java.lang.String convert(long number)
          Convert a number to string according to conversion parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LETTER_VALUE_ALPHABETIC

public static final int LETTER_VALUE_ALPHABETIC
alphabetical

See Also:
Constant Field Values

LETTER_VALUE_TRADITIONAL

public static final int LETTER_VALUE_TRADITIONAL
traditional

See Also:
Constant Field Values
Constructor Detail

NumberConverter

public NumberConverter(java.lang.String format,
                       int groupingSeparator,
                       int groupingSize,
                       int letterValue,
                       java.lang.String features,
                       java.lang.String language,
                       java.lang.String country)
                throws java.lang.IllegalArgumentException
Construct parameterized number converter.

Parameters:
format - format for the page number (may be null or empty, which is treated as null)
groupingSeparator - grouping separator (if zero, then no grouping separator applies)
groupingSize - grouping size (if zero or negative, then no grouping size applies)
letterValue - letter value (must be one of the above letter value enumeration values)
features - features (feature sub-parameters)
language - (may be null or empty, which is treated as null)
country - (may be null or empty, which is treated as null)
Throws:
java.lang.IllegalArgumentException - if format is not a valid UTF-16 string (e.g., has unpaired surrogate)
Method Detail

convert

public java.lang.String convert(long number)
Convert a number to string according to conversion parameters.

Parameters:
number - number to conver
Returns:
string representing converted number

convert

public java.lang.String convert(java.util.List<java.lang.Long> numbers)
Convert list of numbers to string according to conversion parameters.

Parameters:
numbers - list of numbers to convert
Returns:
string representing converted list of numbers

fop 2.3

Copyright 1999-2018 The Apache Software Foundation. All Rights Reserved.