public class DecimalSymbols extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static int |
DECIMAL_SEPARATOR |
static int |
DIGIT |
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 int |
ZERO_DIGIT |
Constructor and Description |
---|
DecimalSymbols()
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
|
int |
getDecimalSeparator()
Get the decimal separator value
|
int |
getDigit()
Get the digit symbol value
|
int |
getGroupingSeparator()
Get the grouping separator value
|
String |
getInfinity()
Get the infinity symbol value
|
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 |
setGroupingSeparator(String value)
Set the character to be used as the grouping separator
|
void |
setHostLanguage(int language) |
void |
setInfinity(String value)
Set the string to be used to represent infinity
|
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 PATTERN_SEPARATOR
public static final int INFINITY
public static final int NAN
public DecimalSymbols()
public void setHostLanguage(int language)
public int getDecimalSeparator()
public int getGroupingSeparator()
public int getDigit()
public int getMinusSign()
public int getPercent()
public int getPerMille()
public int getZeroDigit()
public int getPatternSeparator()
public String getInfinity()
public String getNaN()
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 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 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-2013 Saxonica Limited. All rights reserved.