Duration.java
4.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
package org.joda.time;
import java.io.Serializable;
import org.joda.convert.FromString;
import org.joda.time.base.BaseDuration;
import org.joda.time.field.FieldUtils;
public final class Duration
extends BaseDuration
implements Serializable, ReadableDuration
{
public static final Duration ZERO = new Duration(0L);
private static final long serialVersionUID = 2471658376918L;
public Duration(long paramLong)
{
super(paramLong);
}
public Duration(long paramLong1, long paramLong2)
{
super(paramLong1, paramLong2);
}
public Duration(Object paramObject)
{
super(paramObject);
}
public Duration(ReadableInstant paramReadableInstant1, ReadableInstant paramReadableInstant2)
{
super(paramReadableInstant1, paramReadableInstant2);
}
public static Duration millis(long paramLong)
{
if (paramLong == 0L) {
return ZERO;
}
return new Duration(paramLong);
}
@FromString
public static Duration parse(String paramString)
{
return new Duration(paramString);
}
public static Duration standardDays(long paramLong)
{
if (paramLong == 0L) {
return ZERO;
}
return new Duration(FieldUtils.safeMultiply(paramLong, 86400000));
}
public static Duration standardHours(long paramLong)
{
if (paramLong == 0L) {
return ZERO;
}
return new Duration(FieldUtils.safeMultiply(paramLong, 3600000));
}
public static Duration standardMinutes(long paramLong)
{
if (paramLong == 0L) {
return ZERO;
}
return new Duration(FieldUtils.safeMultiply(paramLong, 60000));
}
public static Duration standardSeconds(long paramLong)
{
if (paramLong == 0L) {
return ZERO;
}
return new Duration(FieldUtils.safeMultiply(paramLong, 1000));
}
public final long getStandardDays()
{
return getMillis() / 86400000L;
}
public final long getStandardHours()
{
return getMillis() / 3600000L;
}
public final long getStandardMinutes()
{
return getMillis() / 60000L;
}
public final long getStandardSeconds()
{
return getMillis() / 1000L;
}
public final Duration minus(long paramLong)
{
return withDurationAdded(paramLong, -1);
}
public final Duration minus(ReadableDuration paramReadableDuration)
{
if (paramReadableDuration == null) {
return this;
}
return withDurationAdded(paramReadableDuration.getMillis(), -1);
}
public final Duration plus(long paramLong)
{
return withDurationAdded(paramLong, 1);
}
public final Duration plus(ReadableDuration paramReadableDuration)
{
if (paramReadableDuration == null) {
return this;
}
return withDurationAdded(paramReadableDuration.getMillis(), 1);
}
public final Duration toDuration()
{
return this;
}
public final Days toStandardDays()
{
return Days.days(FieldUtils.safeToInt(getStandardDays()));
}
public final Hours toStandardHours()
{
return Hours.hours(FieldUtils.safeToInt(getStandardHours()));
}
public final Minutes toStandardMinutes()
{
return Minutes.minutes(FieldUtils.safeToInt(getStandardMinutes()));
}
public final Seconds toStandardSeconds()
{
return Seconds.seconds(FieldUtils.safeToInt(getStandardSeconds()));
}
public final Duration withDurationAdded(long paramLong, int paramInt)
{
if ((paramLong == 0L) || (paramInt == 0)) {
return this;
}
paramLong = FieldUtils.safeMultiply(paramLong, paramInt);
return new Duration(FieldUtils.safeAdd(getMillis(), paramLong));
}
public final Duration withDurationAdded(ReadableDuration paramReadableDuration, int paramInt)
{
if ((paramReadableDuration == null) || (paramInt == 0)) {
return this;
}
return withDurationAdded(paramReadableDuration.getMillis(), paramInt);
}
public final Duration withMillis(long paramLong)
{
if (paramLong == getMillis()) {
return this;
}
return new Duration(paramLong);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/Duration.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/