AbstractReadableInstantFieldProperty.java
5.11 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
package org.joda.time.field;
import java.io.Serializable;
import java.util.Locale;
import org.joda.time.Chronology;
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DateTimeUtils;
import org.joda.time.DurationField;
import org.joda.time.Interval;
import org.joda.time.ReadableInstant;
import org.joda.time.ReadablePartial;
public abstract class AbstractReadableInstantFieldProperty
implements Serializable
{
private static final long serialVersionUID = 1971226328211649661L;
public int compareTo(ReadableInstant paramReadableInstant)
{
if (paramReadableInstant == null) {
throw new IllegalArgumentException("The instant must not be null");
}
int i = get();
int j = paramReadableInstant.get(getFieldType());
if (i < j) {
return -1;
}
if (i > j) {
return 1;
}
return 0;
}
public int compareTo(ReadablePartial paramReadablePartial)
{
if (paramReadablePartial == null) {
throw new IllegalArgumentException("The partial must not be null");
}
int i = get();
int j = paramReadablePartial.get(getFieldType());
if (i < j) {
return -1;
}
if (i > j) {
return 1;
}
return 0;
}
public boolean equals(Object paramObject)
{
if (this == paramObject) {}
do
{
return true;
if (!(paramObject instanceof AbstractReadableInstantFieldProperty)) {
return false;
}
paramObject = (AbstractReadableInstantFieldProperty)paramObject;
} while ((get() == ((AbstractReadableInstantFieldProperty)paramObject).get()) && (getFieldType().equals(((AbstractReadableInstantFieldProperty)paramObject).getFieldType())) && (FieldUtils.equals(getChronology(), ((AbstractReadableInstantFieldProperty)paramObject).getChronology())));
return false;
}
public int get()
{
return getField().get(getMillis());
}
public String getAsShortText()
{
return getAsShortText(null);
}
public String getAsShortText(Locale paramLocale)
{
return getField().getAsShortText(getMillis(), paramLocale);
}
public String getAsString()
{
return Integer.toString(get());
}
public String getAsText()
{
return getAsText(null);
}
public String getAsText(Locale paramLocale)
{
return getField().getAsText(getMillis(), paramLocale);
}
public Chronology getChronology()
{
throw new UnsupportedOperationException("The method getChronology() was added in v1.4 and needs to be implemented by subclasses of AbstractReadableInstantFieldProperty");
}
public int getDifference(ReadableInstant paramReadableInstant)
{
if (paramReadableInstant == null) {
return getField().getDifference(getMillis(), DateTimeUtils.currentTimeMillis());
}
return getField().getDifference(getMillis(), paramReadableInstant.getMillis());
}
public long getDifferenceAsLong(ReadableInstant paramReadableInstant)
{
if (paramReadableInstant == null) {
return getField().getDifferenceAsLong(getMillis(), DateTimeUtils.currentTimeMillis());
}
return getField().getDifferenceAsLong(getMillis(), paramReadableInstant.getMillis());
}
public DurationField getDurationField()
{
return getField().getDurationField();
}
public abstract DateTimeField getField();
public DateTimeFieldType getFieldType()
{
return getField().getType();
}
public int getLeapAmount()
{
return getField().getLeapAmount(getMillis());
}
public DurationField getLeapDurationField()
{
return getField().getLeapDurationField();
}
public int getMaximumShortTextLength(Locale paramLocale)
{
return getField().getMaximumShortTextLength(paramLocale);
}
public int getMaximumTextLength(Locale paramLocale)
{
return getField().getMaximumTextLength(paramLocale);
}
public int getMaximumValue()
{
return getField().getMaximumValue(getMillis());
}
public int getMaximumValueOverall()
{
return getField().getMaximumValue();
}
public abstract long getMillis();
public int getMinimumValue()
{
return getField().getMinimumValue(getMillis());
}
public int getMinimumValueOverall()
{
return getField().getMinimumValue();
}
public String getName()
{
return getField().getName();
}
public DurationField getRangeDurationField()
{
return getField().getRangeDurationField();
}
public int hashCode()
{
return get() * 17 + getFieldType().hashCode() + getChronology().hashCode();
}
public boolean isLeap()
{
return getField().isLeap(getMillis());
}
public long remainder()
{
return getField().remainder(getMillis());
}
public Interval toInterval()
{
DateTimeField localDateTimeField = getField();
long l = localDateTimeField.roundFloor(getMillis());
return new Interval(l, localDateTimeField.add(l, 1));
}
public String toString()
{
return "Property[" + getName() + "]";
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/field/AbstractReadableInstantFieldProperty.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/