PreciseDurationDateTimeField.java
2.07 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
package org.joda.time.field;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DurationField;
public abstract class PreciseDurationDateTimeField
extends BaseDateTimeField
{
final long a;
private final DurationField b;
public PreciseDurationDateTimeField(DateTimeFieldType paramDateTimeFieldType, DurationField paramDurationField)
{
super(paramDateTimeFieldType);
if (!paramDurationField.isPrecise()) {
throw new IllegalArgumentException("Unit duration field must be precise");
}
this.a = paramDurationField.getUnitMillis();
if (this.a < 1L) {
throw new IllegalArgumentException("The unit milliseconds must be at least 1");
}
this.b = paramDurationField;
}
public DurationField getDurationField()
{
return this.b;
}
public int getMaximumValueForSet(long paramLong, int paramInt)
{
return getMaximumValue(paramLong);
}
public int getMinimumValue()
{
return 0;
}
public final long getUnitMillis()
{
return this.a;
}
public boolean isLenient()
{
return false;
}
public long remainder(long paramLong)
{
if (paramLong >= 0L) {
return paramLong % this.a;
}
return (paramLong + 1L) % this.a + this.a - 1L;
}
public long roundCeiling(long paramLong)
{
if (paramLong > 0L)
{
paramLong -= 1L;
return paramLong - paramLong % this.a + this.a;
}
return paramLong - paramLong % this.a;
}
public long roundFloor(long paramLong)
{
if (paramLong >= 0L) {
return paramLong - paramLong % this.a;
}
paramLong = 1L + paramLong;
return paramLong - paramLong % this.a - this.a;
}
public long set(long paramLong, int paramInt)
{
FieldUtils.verifyValueBounds(this, paramInt, getMinimumValue(), getMaximumValueForSet(paramLong, paramInt));
return (paramInt - get(paramLong)) * this.a + paramLong;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/field/PreciseDurationDateTimeField.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/