AbstractPartial.java
6.18 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
package org.joda.time.base;
import org.joda.time.Chronology;
import org.joda.time.DateTime;
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DateTimeUtils;
import org.joda.time.DurationFieldType;
import org.joda.time.ReadableInstant;
import org.joda.time.ReadablePartial;
import org.joda.time.field.FieldUtils;
import org.joda.time.format.DateTimeFormatter;
public abstract class AbstractPartial
implements Comparable<ReadablePartial>, ReadablePartial
{
public int compareTo(ReadablePartial paramReadablePartial)
{
if (this == paramReadablePartial) {}
for (;;)
{
return 0;
if (size() != paramReadablePartial.size()) {
throw new ClassCastException("ReadablePartial objects must have matching field types");
}
int j = size();
int i = 0;
while (i < j)
{
if (getFieldType(i) != paramReadablePartial.getFieldType(i)) {
throw new ClassCastException("ReadablePartial objects must have matching field types");
}
i += 1;
}
j = size();
i = 0;
while (i < j)
{
if (getValue(i) > paramReadablePartial.getValue(i)) {
return 1;
}
if (getValue(i) < paramReadablePartial.getValue(i)) {
return -1;
}
i += 1;
}
}
}
public boolean equals(Object paramObject)
{
boolean bool2 = false;
boolean bool1;
if (this == paramObject) {
bool1 = true;
}
do
{
do
{
return bool1;
bool1 = bool2;
} while (!(paramObject instanceof ReadablePartial));
paramObject = (ReadablePartial)paramObject;
bool1 = bool2;
} while (size() != ((ReadablePartial)paramObject).size());
int j = size();
int i = 0;
for (;;)
{
if (i >= j) {
break label104;
}
bool1 = bool2;
if (getValue(i) != ((ReadablePartial)paramObject).getValue(i)) {
break;
}
bool1 = bool2;
if (getFieldType(i) != ((ReadablePartial)paramObject).getFieldType(i)) {
break;
}
i += 1;
}
label104:
return FieldUtils.equals(getChronology(), ((ReadablePartial)paramObject).getChronology());
}
public int get(DateTimeFieldType paramDateTimeFieldType)
{
return getValue(indexOfSupported(paramDateTimeFieldType));
}
public DateTimeField getField(int paramInt)
{
return getField(paramInt, getChronology());
}
public abstract DateTimeField getField(int paramInt, Chronology paramChronology);
public DateTimeFieldType getFieldType(int paramInt)
{
return getField(paramInt, getChronology()).getType();
}
public DateTimeFieldType[] getFieldTypes()
{
DateTimeFieldType[] arrayOfDateTimeFieldType = new DateTimeFieldType[size()];
int i = 0;
while (i < arrayOfDateTimeFieldType.length)
{
arrayOfDateTimeFieldType[i] = getFieldType(i);
i += 1;
}
return arrayOfDateTimeFieldType;
}
public DateTimeField[] getFields()
{
DateTimeField[] arrayOfDateTimeField = new DateTimeField[size()];
int i = 0;
while (i < arrayOfDateTimeField.length)
{
arrayOfDateTimeField[i] = getField(i);
i += 1;
}
return arrayOfDateTimeField;
}
public int[] getValues()
{
int[] arrayOfInt = new int[size()];
int i = 0;
while (i < arrayOfInt.length)
{
arrayOfInt[i] = getValue(i);
i += 1;
}
return arrayOfInt;
}
public int hashCode()
{
int j = 157;
int i = 0;
int k = size();
while (i < k)
{
j = (j * 23 + getValue(i)) * 23 + getFieldType(i).hashCode();
i += 1;
}
return getChronology().hashCode() + j;
}
public int indexOf(DateTimeFieldType paramDateTimeFieldType)
{
int i = 0;
int j = size();
while (i < j)
{
if (getFieldType(i) == paramDateTimeFieldType) {
return i;
}
i += 1;
}
return -1;
}
protected int indexOf(DurationFieldType paramDurationFieldType)
{
int i = 0;
int j = size();
while (i < j)
{
if (getFieldType(i).getDurationType() == paramDurationFieldType) {
return i;
}
i += 1;
}
return -1;
}
protected int indexOfSupported(DateTimeFieldType paramDateTimeFieldType)
{
int i = indexOf(paramDateTimeFieldType);
if (i == -1) {
throw new IllegalArgumentException("Field '" + paramDateTimeFieldType + "' is not supported");
}
return i;
}
protected int indexOfSupported(DurationFieldType paramDurationFieldType)
{
int i = indexOf(paramDurationFieldType);
if (i == -1) {
throw new IllegalArgumentException("Field '" + paramDurationFieldType + "' is not supported");
}
return i;
}
public boolean isAfter(ReadablePartial paramReadablePartial)
{
if (paramReadablePartial == null) {
throw new IllegalArgumentException("Partial cannot be null");
}
return compareTo(paramReadablePartial) > 0;
}
public boolean isBefore(ReadablePartial paramReadablePartial)
{
if (paramReadablePartial == null) {
throw new IllegalArgumentException("Partial cannot be null");
}
return compareTo(paramReadablePartial) < 0;
}
public boolean isEqual(ReadablePartial paramReadablePartial)
{
if (paramReadablePartial == null) {
throw new IllegalArgumentException("Partial cannot be null");
}
return compareTo(paramReadablePartial) == 0;
}
public boolean isSupported(DateTimeFieldType paramDateTimeFieldType)
{
return indexOf(paramDateTimeFieldType) != -1;
}
public DateTime toDateTime(ReadableInstant paramReadableInstant)
{
Chronology localChronology = DateTimeUtils.getInstantChronology(paramReadableInstant);
return new DateTime(localChronology.set(this, DateTimeUtils.getInstantMillis(paramReadableInstant)), localChronology);
}
public String toString(DateTimeFormatter paramDateTimeFormatter)
{
if (paramDateTimeFormatter == null) {
return toString();
}
return paramDateTimeFormatter.print(this);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/base/AbstractPartial.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/