01: package net.sf.saxon.trans;
02:
03: import java.io.Serializable;
04:
05: /**
06: * This class is modelled on Java's DecimalFormatSymbols, but it allows the use of any
07: * Unicode character to represent symbols such as the decimal point and the grouping
08: * separator, whereas DecimalFormatSymbols restricts these to a char (1-65535). Since
09: * this is essentially a data structure with no behaviour, we don't bother with getter
10: * and setter methods but just expose the fields
11: */
12: public class DecimalSymbols implements Serializable {
13:
14: public int decimalSeparator;
15: public int groupingSeparator;
16: public int digit;
17: public int minusSign;
18: public int percent;
19: public int permill;
20: public int zeroDigit;
21: public int patternSeparator;
22: public String infinity;
23: public String NaN;
24:
25: public boolean equals(Object obj) {
26: if (!(obj instanceof DecimalSymbols))
27: return false;
28: DecimalSymbols o = (DecimalSymbols) obj;
29: return decimalSeparator == o.decimalSeparator
30: && groupingSeparator == o.groupingSeparator
31: && digit == o.digit && minusSign == o.minusSign
32: && percent == o.percent && permill == o.permill
33: && zeroDigit == o.zeroDigit
34: && patternSeparator == o.patternSeparator
35: && infinity.equals(o.infinity) && NaN.equals(o.NaN);
36: }
37:
38: public int hashCode() {
39: return decimalSeparator + (37 * groupingSeparator)
40: + (41 * digit);
41: }
42:
43: }
44:
45: //
46: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
47: // you may not use this file except in compliance with the License. You may obtain a copy of the
48: // License at http://www.mozilla.org/MPL/
49: //
50: // Software distributed under the License is distributed on an "AS IS" basis,
51: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
52: // See the License for the specific language governing rights and limitations under the License.
53: //
54: // The Original Code is: all this file.
55: //
56: // The Initial Developer of the Original Code is Michael H. Kay.
57: //
58: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
59: //
60: // Contributor(s): none.
61: //
|