public class DecimalSymbols extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DECIMAL_SEPARATOR |
static int |
DIGIT |
static int |
EXPONENT_SEPARATOR |
static int |
GROUPING_SEPARATOR |
static int |
INFINITY |
static int |
MINUS_SIGN |
static int |
NAN |
static int |
PATTERN_SEPARATOR |
static int |
PER_MILLE |
static int |
PERCENT |
static String[] |
propertyNames |
static int |
ZERO_DIGIT |
Constructor and Description |
---|
DecimalSymbols(int language,
int languageLevel)
Create a DecimalSymbols object with default values for all properties
|
Modifier and Type | Method and Description |
---|---|
void |
checkConsistency(StructuredQName name)
Check that no character is used in more than one role
|
boolean |
equals(Object obj)
Test if two sets of decimal format symbols are the same
|
void |
export(StructuredQName name,
ExpressionPresenter out) |
int |
getDecimalSeparator()
Get the decimal separator value
|
int |
getDigit()
Get the digit symbol value
|
int |
getExponentSeparator()
Get the exponent separator symbol
|
int |
getGroupingSeparator()
Get the grouping separator value
|
String |
getInfinity()
Get the infinity symbol value
|
int |
getLanguageLevel()
Get the XPath language level
|
int |
getMinusSign()
Get the minus sign value
|
String |
getNaN()
Get the NaN symbol value
|
int |
getPatternSeparator()
Get the pattern separator value
|
int |
getPercent()
Get the percent symbol value
|
int |
getPerMille()
Get the per-mille symbol value
|
int |
getZeroDigit()
Get the zero digit symbol value
|
int |
hashCode() |
static boolean |
isValidZeroDigit(int zeroDigit)
Check that the character declared as a zero-digit is indeed a valid zero-digit
|
void |
setDecimalSeparator(String value)
Set the character to be used as the decimal separator
|
void |
setDigit(String value)
Set the character to be used as the digit symbol (default is '#')
|
void |
setExponentSeparator(String value)
Set the character to be used as the exponent separator
|
void |
setGroupingSeparator(String value)
Set the character to be used as the grouping separator
|
void |
setHostLanguage(int language,
int languageLevel) |
void |
setInfinity(String value)
Set the string to be used to represent infinity
|
void |
setIntProperty(String name,
int value)
Set one of the single-character properties.
|
void |
setMinusSign(String value)
Set the character to be used as the minus sign
|
void |
setNaN(String value)
Set the string to be used to represent NaN
|
void |
setPatternSeparator(String value)
Set the character to be used as the pattern separator (default ';')
|
void |
setPercent(String value)
Set the character to be used as the percent sign
|
void |
setPerMille(String value)
Set the character to be used as the per-mille sign
|
void |
setProperty(int key,
String value,
int precedence)
Set the value of a property
|
void |
setZeroDigit(String value)
Set the character to be used as the zero digit (which determines the digit family used in the output)
|
public static final int DECIMAL_SEPARATOR
public static final int GROUPING_SEPARATOR
public static final int DIGIT
public static final int MINUS_SIGN
public static final int PERCENT
public static final int PER_MILLE
public static final int ZERO_DIGIT
public static final int EXPONENT_SEPARATOR
public static final int PATTERN_SEPARATOR
public static final int INFINITY
public static final int NAN
public static final String[] propertyNames
public DecimalSymbols(int language, int languageLevel)
public void setHostLanguage(int language, int languageLevel)
public int getDecimalSeparator()
public int getGroupingSeparator()
public int getDigit()
public int getMinusSign()
public int getPercent()
public int getPerMille()
public int getZeroDigit()
public int getExponentSeparator()
public int getPatternSeparator()
public String getInfinity()
public String getNaN()
public int getLanguageLevel()
public void setDecimalSeparator(String value) throws XPathException
value
- the character to be usedXPathException
- if the value is not a single Unicode character (a surrogate pair is permitted)public void setGroupingSeparator(String value) throws XPathException
value
- the character to be usedXPathException
- if the value is not a single Unicode character (a surrogate pair is permitted)public void setDigit(String value) throws XPathException
value
- the character to be usedXPathException
- if the value is not a single Unicode character (a surrogate pair is permitted)public void setMinusSign(String value) throws XPathException
value
- the character to be usedXPathException
- if the value is not a single Unicode character (a surrogate pair is permitted)public void setPercent(String value) throws XPathException
value
- the character to be usedXPathException
- if the value is not a single Unicode character (a surrogate pair is permitted)public void setPerMille(String value) throws XPathException
value
- the character to be usedXPathException
- if the value is not a single Unicode character (a surrogate pair is permitted)public void setZeroDigit(String value) throws XPathException
value
- the character to be usedXPathException
- 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 zeropublic void setExponentSeparator(String value) throws XPathException
value
- the character to be usedXPathException
- if the value is not a single Unicode character (a surrogate pair is permitted)public void setPatternSeparator(String value) throws XPathException
value
- the character to be usedXPathException
- if the value is not a single Unicode character (a surrogate pair is permitted)public void setInfinity(String value) throws XPathException
value
- the string to be usedXPathException
- - should not happenpublic void setNaN(String value) throws XPathException
value
- the string to be usedXPathException
- - should not happenpublic void setProperty(int key, String value, int precedence) throws XPathException
key
- the integer key of the property to be setvalue
- the value of the property as a string (in many cases, this must be a single character)precedence
- the precedence of the property valueXPathException
- 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.public void setIntProperty(String name, int value)
name
- the name of the propertyvalue
- the Unicode codepoint of the property valuepublic void export(StructuredQName name, ExpressionPresenter out)
public void checkConsistency(StructuredQName name) throws XPathException
name
- the name of the decimal format (null for the unnamed decimal format)XPathException
- if the same character is used in conflicting rules, for example as decimal separator
and also as grouping separatorpublic static boolean isValidZeroDigit(int zeroDigit)
zeroDigit
- the value to be checkedpublic boolean equals(Object obj)
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.