AbstractInstant.java
5.05 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
package org.joda.time.base;
import java.util.Date;
import org.joda.convert.ToString;
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.DateTimeZone;
import org.joda.time.Instant;
import org.joda.time.MutableDateTime;
import org.joda.time.ReadableInstant;
import org.joda.time.chrono.ISOChronology;
import org.joda.time.field.FieldUtils;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
public abstract class AbstractInstant
implements ReadableInstant
{
public int compareTo(ReadableInstant paramReadableInstant)
{
if (this == paramReadableInstant) {}
long l1;
long l2;
do
{
return 0;
l1 = paramReadableInstant.getMillis();
l2 = getMillis();
} while (l2 == l1);
if (l2 < l1) {
return -1;
}
return 1;
}
public boolean equals(Object paramObject)
{
if (this == paramObject) {}
do
{
return true;
if (!(paramObject instanceof ReadableInstant)) {
return false;
}
paramObject = (ReadableInstant)paramObject;
} while ((getMillis() == ((ReadableInstant)paramObject).getMillis()) && (FieldUtils.equals(getChronology(), ((ReadableInstant)paramObject).getChronology())));
return false;
}
public int get(DateTimeField paramDateTimeField)
{
if (paramDateTimeField == null) {
throw new IllegalArgumentException("The DateTimeField must not be null");
}
return paramDateTimeField.get(getMillis());
}
public int get(DateTimeFieldType paramDateTimeFieldType)
{
if (paramDateTimeFieldType == null) {
throw new IllegalArgumentException("The DateTimeFieldType must not be null");
}
return paramDateTimeFieldType.getField(getChronology()).get(getMillis());
}
public DateTimeZone getZone()
{
return getChronology().getZone();
}
public int hashCode()
{
return (int)(getMillis() ^ getMillis() >>> 32) + getChronology().hashCode();
}
public boolean isAfter(long paramLong)
{
return getMillis() > paramLong;
}
public boolean isAfter(ReadableInstant paramReadableInstant)
{
return isAfter(DateTimeUtils.getInstantMillis(paramReadableInstant));
}
public boolean isAfterNow()
{
return isAfter(DateTimeUtils.currentTimeMillis());
}
public boolean isBefore(long paramLong)
{
return getMillis() < paramLong;
}
public boolean isBefore(ReadableInstant paramReadableInstant)
{
return isBefore(DateTimeUtils.getInstantMillis(paramReadableInstant));
}
public boolean isBeforeNow()
{
return isBefore(DateTimeUtils.currentTimeMillis());
}
public boolean isEqual(long paramLong)
{
return getMillis() == paramLong;
}
public boolean isEqual(ReadableInstant paramReadableInstant)
{
return isEqual(DateTimeUtils.getInstantMillis(paramReadableInstant));
}
public boolean isEqualNow()
{
return isEqual(DateTimeUtils.currentTimeMillis());
}
public boolean isSupported(DateTimeFieldType paramDateTimeFieldType)
{
if (paramDateTimeFieldType == null) {
return false;
}
return paramDateTimeFieldType.getField(getChronology()).isSupported();
}
public Date toDate()
{
return new Date(getMillis());
}
public DateTime toDateTime()
{
return new DateTime(getMillis(), getZone());
}
public DateTime toDateTime(Chronology paramChronology)
{
return new DateTime(getMillis(), paramChronology);
}
public DateTime toDateTime(DateTimeZone paramDateTimeZone)
{
paramDateTimeZone = DateTimeUtils.getChronology(getChronology()).withZone(paramDateTimeZone);
return new DateTime(getMillis(), paramDateTimeZone);
}
public DateTime toDateTimeISO()
{
return new DateTime(getMillis(), ISOChronology.getInstance(getZone()));
}
public Instant toInstant()
{
return new Instant(getMillis());
}
public MutableDateTime toMutableDateTime()
{
return new MutableDateTime(getMillis(), getZone());
}
public MutableDateTime toMutableDateTime(Chronology paramChronology)
{
return new MutableDateTime(getMillis(), paramChronology);
}
public MutableDateTime toMutableDateTime(DateTimeZone paramDateTimeZone)
{
paramDateTimeZone = DateTimeUtils.getChronology(getChronology()).withZone(paramDateTimeZone);
return new MutableDateTime(getMillis(), paramDateTimeZone);
}
public MutableDateTime toMutableDateTimeISO()
{
return new MutableDateTime(getMillis(), ISOChronology.getInstance(getZone()));
}
@ToString
public String toString()
{
return ISODateTimeFormat.dateTime().print(this);
}
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/AbstractInstant.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/