Package net.sf.saxon.trans
Class DecimalSymbols
java.lang.Object
net.sf.saxon.trans.DecimalSymbols
This class is modelled on Java's DecimalFormatSymbols, but it allows the use of any
 Unicode character to represent symbols such as the decimal point and the grouping
 separator, whereas DecimalFormatSymbols restricts these to a char (1-65535).
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final String[]static final int
- 
Constructor SummaryConstructorsConstructorDescriptionDecimalSymbols(HostLanguage language, int languageLevel) Create a DecimalSymbols object with default values for all properties
- 
Method SummaryModifier and TypeMethodDescriptionvoidCheck that no character is used in more than one rolebooleanTest if two sets of decimal format symbols are the samevoidexport(StructuredQName name, ExpressionPresenter out) intGet the decimal separator valueintgetDigit()Get the digit symbol valueintGet the exponent separator symbolintGet the grouping separator valueGet the infinity symbol valueintGet the minus sign valuegetNaN()Get the NaN symbol valueintGet the pattern separator valueintGet the percent symbol valueintGet the per-mille symbol valueintGet the zero digit symbol valueinthashCode()static booleanisValidZeroDigit(int zeroDigit) Check that the character declared as a zero-digit is indeed a valid zero-digitvoidsetDecimalSeparator(String value) Set the character to be used as the decimal separatorvoidSet the character to be used as the digit symbol (default is '#')voidsetExponentSeparator(String value) Set the character to be used as the exponent separatorvoidsetGroupingSeparator(String value) Set the character to be used as the grouping separatorvoidsetHostLanguage(HostLanguage language, int languageLevel) voidsetInfinity(String value) Set the string to be used to represent infinityvoidsetIntProperty(String name, int value) Set one of the single-character properties.voidsetMinusSign(String value) Set the character to be used as the minus signvoidSet the string to be used to represent NaNvoidsetPatternSeparator(String value) Set the character to be used as the pattern separator (default ';')voidsetPercent(String value) Set the character to be used as the percent signvoidsetPerMille(String value) Set the character to be used as the per-mille signvoidsetProperty(int key, String value, int precedence) Set the value of a propertyvoidsetZeroDigit(String value) Set the character to be used as the zero digit (which determines the digit family used in the output)
- 
Field Details- 
DECIMAL_SEPARATORpublic static final int DECIMAL_SEPARATOR- See Also:
 
- 
GROUPING_SEPARATORpublic static final int GROUPING_SEPARATOR- See Also:
 
- 
DIGITpublic static final int DIGIT- See Also:
 
- 
MINUS_SIGNpublic static final int MINUS_SIGN- See Also:
 
- 
PERCENTpublic static final int PERCENT- See Also:
 
- 
PER_MILLEpublic static final int PER_MILLE- See Also:
 
- 
ZERO_DIGITpublic static final int ZERO_DIGIT- See Also:
 
- 
EXPONENT_SEPARATORpublic static final int EXPONENT_SEPARATOR- See Also:
 
- 
PATTERN_SEPARATORpublic static final int PATTERN_SEPARATOR- See Also:
 
- 
INFINITYpublic static final int INFINITY- See Also:
 
- 
NANpublic static final int NAN- See Also:
 
- 
propertyNames
 
- 
- 
Constructor Details- 
DecimalSymbolsCreate a DecimalSymbols object with default values for all properties
 
- 
- 
Method Details- 
setHostLanguage
- 
getDecimalSeparatorpublic int getDecimalSeparator()Get the decimal separator value- Returns:
- the decimal separator value that has been explicitly set, or its default ('.')
 
- 
getGroupingSeparatorpublic int getGroupingSeparator()Get the grouping separator value- Returns:
- the grouping separator value that has been explicitly set, or its default (',')
 
- 
getDigitpublic int getDigit()Get the digit symbol value- Returns:
- the digit symbol value that has been explicitly set, or its default ('#')
 
- 
getMinusSignpublic int getMinusSign()Get the minus sign value- Returns:
- the minus sign value that has been explicitly set, or its default ('-')
 
- 
getPercentpublic int getPercent()Get the percent symbol value- Returns:
- the percent symbol value that has been explicitly set, or its default ('%')
 
- 
getPerMillepublic int getPerMille()Get the per-mille symbol value- Returns:
- the per-mille symbol value that has been explicitly set, or its default
 
- 
getZeroDigitpublic int getZeroDigit()Get the zero digit symbol value- Returns:
- the zero digit symbol value that has been explicitly set, or its default ('0')
 
- 
getExponentSeparatorpublic int getExponentSeparator()Get the exponent separator symbol- Returns:
- the exponent separator character that has been explicitly set, or its default ('e');
 
- 
getPatternSeparatorpublic int getPatternSeparator()Get the pattern separator value- Returns:
- the pattern separator value that has been explicitly set, or its default (';')
 
- 
getInfinityGet the infinity symbol value- Returns:
- the infinity symbol value that has been explicitly set, or its default ('Infinity')
 
- 
getNaNGet the NaN symbol value- Returns:
- the NaN symbol value that has been explicitly set, or its default ('NaN')
 
- 
setDecimalSeparatorSet the character to be used as the decimal separator- Parameters:
- value- the character to be used
- Throws:
- XPathException- if the value is not a single Unicode character (a surrogate pair is permitted)
 
- 
setGroupingSeparatorSet the character to be used as the grouping separator- Parameters:
- value- the character to be used
- Throws:
- XPathException- if the value is not a single Unicode character (a surrogate pair is permitted)
 
- 
setDigitSet the character to be used as the digit symbol (default is '#')- Parameters:
- value- the character to be used
- Throws:
- XPathException- if the value is not a single Unicode character (a surrogate pair is permitted)
 
- 
setMinusSignSet the character to be used as the minus sign- Parameters:
- value- the character to be used
- Throws:
- XPathException- if the value is not a single Unicode character (a surrogate pair is permitted)
 
- 
setPercentSet the character to be used as the percent sign- Parameters:
- value- the character to be used
- Throws:
- XPathException- if the value is not a single Unicode character (a surrogate pair is permitted)
 
- 
setPerMilleSet the character to be used as the per-mille sign- Parameters:
- value- the character to be used
- Throws:
- XPathException- if the value is not a single Unicode character (a surrogate pair is permitted)
 
- 
setZeroDigitSet the character to be used as the zero digit (which determines the digit family used in the output)- Parameters:
- value- the character to be used
- Throws:
- XPathException- if the value is not a single Unicode character (a surrogate pair is permitted), or if it is not a character classified in Unicode as a digit with numeric value zero
 
- 
setExponentSeparatorSet the character to be used as the exponent separator- Parameters:
- value- the character to be used
- Throws:
- XPathException- if the value is not a single Unicode character (a surrogate pair is permitted)
 
- 
setPatternSeparatorSet the character to be used as the pattern separator (default ';')- Parameters:
- value- the character to be used
- Throws:
- XPathException- if the value is not a single Unicode character (a surrogate pair is permitted)
 
- 
setInfinitySet the string to be used to represent infinity- Parameters:
- value- the string to be used
- Throws:
- XPathException- - should not happen
 
- 
setNaNSet the string to be used to represent NaN- Parameters:
- value- the string to be used
- Throws:
- XPathException- - should not happen
 
- 
setPropertySet the value of a property- Parameters:
- key- the integer key of the property to be set
- value- the value of the property as a string (in many cases, this must be a single character)
- precedence- the precedence of the property value
- Throws:
- XPathException- if the property is invalid. This method does not check the consistency of different properties. If two different values are supplied for the same property at the same precedence, the method does not complain, but notes the fact, and if the inconsistency is not subsequently cleared by supplying another value at a higher precedence, the error is reported when the checkConsistency() method is subsequently called.
 
- 
setIntPropertySet one of the single-character properties. Used when reloading an exported package- Parameters:
- name- the name of the property
- value- the Unicode codepoint of the property value
 
- 
export
- 
checkConsistencyCheck that no character is used in more than one role- Parameters:
- name- the name of the decimal format (null for the unnamed decimal format)
- Throws:
- XPathException- if the same character is used in conflicting rules, for example as decimal separator and also as grouping separator
 
- 
isValidZeroDigitpublic static boolean isValidZeroDigit(int zeroDigit) Check that the character declared as a zero-digit is indeed a valid zero-digit- Parameters:
- zeroDigit- the value to be checked
- Returns:
- false if it is not a valid zero-digit
 
- 
equalsTest if two sets of decimal format symbols are the same
- 
hashCodepublic int hashCode()
 
-