PreciseDateTimeField.java
1.79 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
package org.joda.time.field;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DurationField;
public class PreciseDateTimeField
extends PreciseDurationDateTimeField
{
private final int b;
private final DurationField c;
public PreciseDateTimeField(DateTimeFieldType paramDateTimeFieldType, DurationField paramDurationField1, DurationField paramDurationField2)
{
super(paramDateTimeFieldType, paramDurationField1);
if (!paramDurationField2.isPrecise()) {
throw new IllegalArgumentException("Range duration field must be precise");
}
this.b = ((int)(paramDurationField2.getUnitMillis() / getUnitMillis()));
if (this.b < 2) {
throw new IllegalArgumentException("The effective range must be at least 2");
}
this.c = paramDurationField2;
}
public long addWrapField(long paramLong, int paramInt)
{
int i = get(paramLong);
return (FieldUtils.getWrappedValue(i, paramInt, getMinimumValue(), getMaximumValue()) - i) * getUnitMillis() + paramLong;
}
public int get(long paramLong)
{
if (paramLong >= 0L) {
return (int)(paramLong / getUnitMillis() % this.b);
}
return this.b - 1 + (int)((1L + paramLong) / getUnitMillis() % this.b);
}
public int getMaximumValue()
{
return this.b - 1;
}
public int getRange()
{
return this.b;
}
public DurationField getRangeDurationField()
{
return this.c;
}
public long set(long paramLong, int paramInt)
{
FieldUtils.verifyValueBounds(this, paramInt, getMinimumValue(), getMaximumValue());
return (paramInt - get(paramLong)) * this.a + paramLong;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/field/PreciseDateTimeField.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/