DateTimeComparator.java
5.1 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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
package org.joda.time;
import java.io.Serializable;
import java.util.Comparator;
import org.joda.time.convert.ConverterManager;
import org.joda.time.convert.InstantConverter;
public class DateTimeComparator
implements Serializable, Comparator<Object>
{
private static final DateTimeComparator a = new DateTimeComparator(null, null);
private static final DateTimeComparator b = new DateTimeComparator(DateTimeFieldType.dayOfYear(), null);
private static final DateTimeComparator c = new DateTimeComparator(null, DateTimeFieldType.dayOfYear());
private static final long serialVersionUID = -6097339773320178364L;
private final DateTimeFieldType d;
private final DateTimeFieldType e;
protected DateTimeComparator(DateTimeFieldType paramDateTimeFieldType1, DateTimeFieldType paramDateTimeFieldType2)
{
this.d = paramDateTimeFieldType1;
this.e = paramDateTimeFieldType2;
}
public static DateTimeComparator getDateOnlyInstance()
{
return b;
}
public static DateTimeComparator getInstance()
{
return a;
}
public static DateTimeComparator getInstance(DateTimeFieldType paramDateTimeFieldType)
{
return getInstance(paramDateTimeFieldType, null);
}
public static DateTimeComparator getInstance(DateTimeFieldType paramDateTimeFieldType1, DateTimeFieldType paramDateTimeFieldType2)
{
if ((paramDateTimeFieldType1 == null) && (paramDateTimeFieldType2 == null)) {
return a;
}
if ((paramDateTimeFieldType1 == DateTimeFieldType.dayOfYear()) && (paramDateTimeFieldType2 == null)) {
return b;
}
if ((paramDateTimeFieldType1 == null) && (paramDateTimeFieldType2 == DateTimeFieldType.dayOfYear())) {
return c;
}
return new DateTimeComparator(paramDateTimeFieldType1, paramDateTimeFieldType2);
}
public static DateTimeComparator getTimeOnlyInstance()
{
return c;
}
private Object readResolve()
{
return getInstance(this.d, this.e);
}
public int compare(Object paramObject1, Object paramObject2)
{
Object localObject = ConverterManager.getInstance().getInstantConverter(paramObject1);
Chronology localChronology = ((InstantConverter)localObject).getChronology(paramObject1, null);
long l4 = ((InstantConverter)localObject).getInstantMillis(paramObject1, localChronology);
paramObject1 = ConverterManager.getInstance().getInstantConverter(paramObject2);
localObject = ((InstantConverter)paramObject1).getChronology(paramObject2, null);
long l3 = ((InstantConverter)paramObject1).getInstantMillis(paramObject2, (Chronology)localObject);
long l1 = l3;
long l2 = l4;
if (this.d != null)
{
l2 = this.d.getField(localChronology).roundFloor(l4);
l1 = this.d.getField((Chronology)localObject).roundFloor(l3);
}
l4 = l1;
l3 = l2;
if (this.e != null)
{
l3 = this.e.getField(localChronology).remainder(l2);
l4 = this.e.getField((Chronology)localObject).remainder(l1);
}
if (l3 < l4) {
return -1;
}
if (l3 > l4) {
return 1;
}
return 0;
}
public boolean equals(Object paramObject)
{
boolean bool2 = false;
boolean bool1 = bool2;
if ((paramObject instanceof DateTimeComparator))
{
paramObject = (DateTimeComparator)paramObject;
if (this.d != ((DateTimeComparator)paramObject).getLowerLimit())
{
bool1 = bool2;
if (this.d != null)
{
bool1 = bool2;
if (!this.d.equals(((DateTimeComparator)paramObject).getLowerLimit())) {}
}
}
else if (this.e != ((DateTimeComparator)paramObject).getUpperLimit())
{
bool1 = bool2;
if (this.e != null)
{
bool1 = bool2;
if (!this.e.equals(((DateTimeComparator)paramObject).getUpperLimit())) {}
}
}
else
{
bool1 = true;
}
}
return bool1;
}
public DateTimeFieldType getLowerLimit()
{
return this.d;
}
public DateTimeFieldType getUpperLimit()
{
return this.e;
}
public int hashCode()
{
int j = 0;
int i;
if (this.d == null)
{
i = 0;
if (this.e != null) {
break label36;
}
}
for (;;)
{
return i + j * 123;
i = this.d.hashCode();
break;
label36:
j = this.e.hashCode();
}
}
public String toString()
{
if (this.d == this.e)
{
localStringBuilder = new StringBuilder("DateTimeComparator[");
if (this.d == null) {}
for (str = "";; str = this.d.getName()) {
return str + "]";
}
}
StringBuilder localStringBuilder = new StringBuilder("DateTimeComparator[");
if (this.d == null)
{
str = "";
localStringBuilder = localStringBuilder.append(str).append("-");
if (this.e != null) {
break label122;
}
}
label122:
for (String str = "";; str = this.e.getName())
{
return str + "]";
str = this.d.getName();
break;
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/DateTimeComparator.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/