KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > trans > DecimalSymbols


1 package net.sf.saxon.trans;
2
3 import java.io.Serializable JavaDoc;
4
5 /**
6  * This class is modelled on Java's DecimalFormatSymbols, but it allows the use of any
7  * Unicode character to represent symbols such as the decimal point and the grouping
8  * separator, whereas DecimalFormatSymbols restricts these to a char (1-65535). Since
9  * 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 JavaDoc {
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 JavaDoc infinity;
23     public String JavaDoc NaN;
24
25
26     public boolean equals(Object JavaDoc obj) {
27         if (!(obj instanceof DecimalSymbols)) return false;
28         DecimalSymbols o = (DecimalSymbols)obj;
29         return decimalSeparator == o.decimalSeparator &&
30                 groupingSeparator == o.groupingSeparator &&
31                 digit == o.digit &&
32                 minusSign == o.minusSign &&
33                 percent == o.percent &&
34                 permill == o.permill &&
35                 zeroDigit == o.zeroDigit &&
36                 patternSeparator == o.patternSeparator &&
37                 infinity.equals(o.infinity) &&
38                 NaN.equals(o.NaN);
39     }
40
41     public int hashCode() {
42         return decimalSeparator + (37*groupingSeparator) + (41*digit);
43     }
44
45 }
46
47 //
48
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
49
// you may not use this file except in compliance with the License. You may obtain a copy of the
50
// License at http://www.mozilla.org/MPL/
51
//
52
// Software distributed under the License is distributed on an "AS IS" basis,
53
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
54
// See the License for the specific language governing rights and limitations under the License.
55
//
56
// The Original Code is: all this file.
57
//
58
// The Initial Developer of the Original Code is Michael H. Kay.
59
//
60
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
61
//
62
// Contributor(s): none.
63
//
64

65
Popular Tags