ISOChronology.java
4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
package org.joda.time.chrono;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.joda.time.Chronology;
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DateTimeZone;
import org.joda.time.field.DividedDateTimeField;
import org.joda.time.field.RemainderDateTimeField;
import uv;
public final class ISOChronology
extends AssembledChronology
{
private static final ISOChronology a;
private static final ISOChronology[] b;
private static final Map<DateTimeZone, ISOChronology> c = new HashMap();
private static final long serialVersionUID = -6212696554273812441L;
static
{
b = new ISOChronology[64];
a = new ISOChronology(GregorianChronology.getInstanceUTC());
c.put(DateTimeZone.UTC, a);
}
private ISOChronology(Chronology paramChronology)
{
super(paramChronology, null);
}
public static ISOChronology getInstance()
{
return getInstance(DateTimeZone.getDefault());
}
public static ISOChronology getInstance(DateTimeZone paramDateTimeZone)
{
DateTimeZone localDateTimeZone = paramDateTimeZone;
if (paramDateTimeZone == null) {
localDateTimeZone = DateTimeZone.getDefault();
}
int i = System.identityHashCode(localDateTimeZone) & 0x3F;
paramDateTimeZone = b[i];
if ((paramDateTimeZone != null) && (paramDateTimeZone.getZone() == localDateTimeZone)) {
return paramDateTimeZone;
}
synchronized (c)
{
ISOChronology localISOChronology = (ISOChronology)c.get(localDateTimeZone);
paramDateTimeZone = localISOChronology;
if (localISOChronology == null)
{
paramDateTimeZone = new ISOChronology(ZonedChronology.getInstance(a, localDateTimeZone));
c.put(localDateTimeZone, paramDateTimeZone);
}
b[i] = paramDateTimeZone;
return paramDateTimeZone;
}
}
public static ISOChronology getInstanceUTC()
{
return a;
}
private Object writeReplace()
{
return new a(getZone());
}
protected final void assemble(AssembledChronology.Fields paramFields)
{
if (getBase().getZone() == DateTimeZone.UTC)
{
paramFields.centuryOfEra = new DividedDateTimeField(uv.a, DateTimeFieldType.centuryOfEra(), 100);
paramFields.yearOfCentury = new RemainderDateTimeField((DividedDateTimeField)paramFields.centuryOfEra, DateTimeFieldType.yearOfCentury());
paramFields.weekyearOfCentury = new RemainderDateTimeField((DividedDateTimeField)paramFields.centuryOfEra, DateTimeFieldType.weekyearOfCentury());
paramFields.centuries = paramFields.centuryOfEra.getDurationField();
}
}
public final boolean equals(Object paramObject)
{
return super.equals(paramObject);
}
public final int hashCode()
{
return "ISO".hashCode() * 11 + getZone().hashCode();
}
public final String toString()
{
String str = "ISOChronology";
DateTimeZone localDateTimeZone = getZone();
if (localDateTimeZone != null) {
str = "ISOChronology" + '[' + localDateTimeZone.getID() + ']';
}
return str;
}
public final Chronology withUTC()
{
return a;
}
public final Chronology withZone(DateTimeZone paramDateTimeZone)
{
DateTimeZone localDateTimeZone = paramDateTimeZone;
if (paramDateTimeZone == null) {
localDateTimeZone = DateTimeZone.getDefault();
}
if (localDateTimeZone == getZone()) {
return this;
}
return getInstance(localDateTimeZone);
}
static final class a
implements Serializable
{
private static final long serialVersionUID = -6212696554273812441L;
private transient DateTimeZone a;
a(DateTimeZone paramDateTimeZone)
{
this.a = paramDateTimeZone;
}
private void readObject(ObjectInputStream paramObjectInputStream)
throws IOException, ClassNotFoundException
{
this.a = ((DateTimeZone)paramObjectInputStream.readObject());
}
private Object readResolve()
{
return ISOChronology.getInstance(this.a);
}
private void writeObject(ObjectOutputStream paramObjectOutputStream)
throws IOException
{
paramObjectOutputStream.writeObject(this.a);
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/chrono/ISOChronology.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/