public class DecimalSymbols
extends java.lang.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 java.lang.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(java.lang.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
|
java.lang.String |
getInfinity()
Get the infinity symbol value
|
int |
getLanguageLevel()
Get the XPath language level
|
int |
getMinusSign()
Get the minus sign value
|
java.lang.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(java.lang.String value)
Set the character to be used as the decimal separator
|
void |
setDigit(java.lang.String value)
Set the character to be used as the digit symbol (default is '#')
|
void |
setExponentSeparator(java.lang.String value)
Set the character to be used as the exponent separator
|
void |
setGroupingSeparator(java.lang.String value)
Set the character to be used as the grouping separator
|
void |
setHostLanguage(int language,
int languageLevel) |
void |
setInfinity(java.lang.String value)
Set the string to be used to represent infinity
|
void |
setIntProperty(java.lang.String name,
int value)
Set one of the single-character properties.
|
void |
setMinusSign(java.lang.String value)
Set the character to be used as the minus sign
|
void |
setNaN(java.lang.String value)
Set the string to be used to represent NaN
|
void |
setPatternSeparator(java.lang.String value)
Set the character to be used as the pattern separator (default ';')
|
void |
setPercent(java.lang.String value)
Set the character to be used as the percent sign
|
void |
setPerMille(java.lang.String value)
Set the character to be used as the per-mille sign
|
void |
setProperty(int key,
java.lang.String value,
int precedence)
Set the value of a property
|
void |
setZeroDigit(java.lang.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 java.lang.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 java.lang.String getInfinity()
public java.lang.String getNaN()
public int getLanguageLevel()
public void setDecimalSeparator(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.String value) throws XPathException
value
- the string to be usedXPathException
- - should not happenpublic void setNaN(java.lang.String value) throws XPathException
value
- the string to be usedXPathException
- - should not happenpublic void setProperty(int key, java.lang.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(java.lang.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(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other set of symbolspublic int hashCode()
hashCode
in class java.lang.Object
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.