Seconds.java
5.24 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
package org.joda.time;
import org.joda.convert.FromString;
import org.joda.convert.ToString;
import org.joda.time.base.BaseSingleFieldPeriod;
import org.joda.time.field.FieldUtils;
import org.joda.time.format.ISOPeriodFormat;
import org.joda.time.format.PeriodFormatter;
public final class Seconds
extends BaseSingleFieldPeriod
{
public static final Seconds MAX_VALUE = new Seconds(Integer.MAX_VALUE);
public static final Seconds MIN_VALUE = new Seconds(Integer.MIN_VALUE);
public static final Seconds ONE;
public static final Seconds THREE;
public static final Seconds TWO;
public static final Seconds ZERO = new Seconds(0);
private static final PeriodFormatter a = ISOPeriodFormat.standard().withParseType(PeriodType.seconds());
private static final long serialVersionUID = 87525275727380862L;
static
{
ONE = new Seconds(1);
TWO = new Seconds(2);
THREE = new Seconds(3);
}
private Seconds(int paramInt)
{
super(paramInt);
}
@FromString
public static Seconds parseSeconds(String paramString)
{
if (paramString == null) {
return ZERO;
}
return seconds(a.parsePeriod(paramString).getSeconds());
}
private Object readResolve()
{
return seconds(getValue());
}
public static Seconds seconds(int paramInt)
{
switch (paramInt)
{
default:
return new Seconds(paramInt);
case 0:
return ZERO;
case 1:
return ONE;
case 2:
return TWO;
case 3:
return THREE;
case 2147483647:
return MAX_VALUE;
}
return MIN_VALUE;
}
public static Seconds secondsBetween(ReadableInstant paramReadableInstant1, ReadableInstant paramReadableInstant2)
{
return seconds(BaseSingleFieldPeriod.between(paramReadableInstant1, paramReadableInstant2, DurationFieldType.seconds()));
}
public static Seconds secondsBetween(ReadablePartial paramReadablePartial1, ReadablePartial paramReadablePartial2)
{
if (((paramReadablePartial1 instanceof LocalTime)) && ((paramReadablePartial2 instanceof LocalTime))) {
return seconds(DateTimeUtils.getChronology(paramReadablePartial1.getChronology()).seconds().getDifference(((LocalTime)paramReadablePartial2).getLocalMillis(), ((LocalTime)paramReadablePartial1).getLocalMillis()));
}
return seconds(BaseSingleFieldPeriod.between(paramReadablePartial1, paramReadablePartial2, ZERO));
}
public static Seconds secondsIn(ReadableInterval paramReadableInterval)
{
if (paramReadableInterval == null) {
return ZERO;
}
return seconds(BaseSingleFieldPeriod.between(paramReadableInterval.getStart(), paramReadableInterval.getEnd(), DurationFieldType.seconds()));
}
public static Seconds standardSecondsIn(ReadablePeriod paramReadablePeriod)
{
return seconds(BaseSingleFieldPeriod.standardPeriodIn(paramReadablePeriod, 1000L));
}
public final Seconds dividedBy(int paramInt)
{
if (paramInt == 1) {
return this;
}
return seconds(getValue() / paramInt);
}
public final DurationFieldType getFieldType()
{
return DurationFieldType.seconds();
}
public final PeriodType getPeriodType()
{
return PeriodType.seconds();
}
public final int getSeconds()
{
return getValue();
}
public final boolean isGreaterThan(Seconds paramSeconds)
{
if (paramSeconds == null) {
if (getValue() <= 0) {}
}
while (getValue() > paramSeconds.getValue())
{
return true;
return false;
}
return false;
}
public final boolean isLessThan(Seconds paramSeconds)
{
if (paramSeconds == null) {
if (getValue() >= 0) {}
}
while (getValue() < paramSeconds.getValue())
{
return true;
return false;
}
return false;
}
public final Seconds minus(int paramInt)
{
return plus(FieldUtils.safeNegate(paramInt));
}
public final Seconds minus(Seconds paramSeconds)
{
if (paramSeconds == null) {
return this;
}
return minus(paramSeconds.getValue());
}
public final Seconds multipliedBy(int paramInt)
{
return seconds(FieldUtils.safeMultiply(getValue(), paramInt));
}
public final Seconds negated()
{
return seconds(FieldUtils.safeNegate(getValue()));
}
public final Seconds plus(int paramInt)
{
if (paramInt == 0) {
return this;
}
return seconds(FieldUtils.safeAdd(getValue(), paramInt));
}
public final Seconds plus(Seconds paramSeconds)
{
if (paramSeconds == null) {
return this;
}
return plus(paramSeconds.getValue());
}
public final Days toStandardDays()
{
return Days.days(getValue() / 86400);
}
public final Duration toStandardDuration()
{
return new Duration(getValue() * 1000L);
}
public final Hours toStandardHours()
{
return Hours.hours(getValue() / 3600);
}
public final Minutes toStandardMinutes()
{
return Minutes.minutes(getValue() / 60);
}
public final Weeks toStandardWeeks()
{
return Weeks.weeks(getValue() / 604800);
}
@ToString
public final String toString()
{
return "PT" + String.valueOf(getValue()) + "S";
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/Seconds.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/