DividedDateTimeField.java
4.06 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
package org.joda.time.field;
import org.joda.time.DateTimeField;
import org.joda.time.DateTimeFieldType;
import org.joda.time.DurationField;
public class DividedDateTimeField
extends DecoratedDateTimeField
{
final int a;
final DurationField b;
private final int c;
private final int d;
public DividedDateTimeField(DateTimeField paramDateTimeField, DateTimeFieldType paramDateTimeFieldType, int paramInt)
{
super(paramDateTimeField, paramDateTimeFieldType);
if (paramInt < 2) {
throw new IllegalArgumentException("The divisor must be at least 2");
}
DurationField localDurationField = paramDateTimeField.getDurationField();
int i;
label59:
int j;
if (localDurationField == null)
{
this.b = null;
this.a = paramInt;
i = paramDateTimeField.getMinimumValue();
if (i < 0) {
break label108;
}
i /= paramInt;
j = paramDateTimeField.getMaximumValue();
if (j < 0) {
break label121;
}
}
label108:
label121:
for (paramInt = j / paramInt;; paramInt = (j + 1) / paramInt - 1)
{
this.c = i;
this.d = paramInt;
return;
this.b = new ScaledDurationField(localDurationField, paramDateTimeFieldType.getDurationType(), paramInt);
break;
i = (i + 1) / paramInt - 1;
break label59;
}
}
public DividedDateTimeField(RemainderDateTimeField paramRemainderDateTimeField, DateTimeFieldType paramDateTimeFieldType)
{
super(paramRemainderDateTimeField.getWrappedField(), paramDateTimeFieldType);
int j = paramRemainderDateTimeField.a;
this.a = j;
this.b = paramRemainderDateTimeField.b;
paramRemainderDateTimeField = getWrappedField();
int i = paramRemainderDateTimeField.getMinimumValue();
int k;
if (i >= 0)
{
i /= j;
k = paramRemainderDateTimeField.getMaximumValue();
if (k < 0) {
break label90;
}
}
label90:
for (j = k / j;; j = (k + 1) / j - 1)
{
this.c = i;
this.d = j;
return;
i = (i + 1) / j - 1;
break;
}
}
public long add(long paramLong, int paramInt)
{
return getWrappedField().add(paramLong, this.a * paramInt);
}
public long add(long paramLong1, long paramLong2)
{
return getWrappedField().add(paramLong1, this.a * paramLong2);
}
public long addWrapField(long paramLong, int paramInt)
{
return set(paramLong, FieldUtils.getWrappedValue(get(paramLong), paramInt, this.c, this.d));
}
public int get(long paramLong)
{
int i = getWrappedField().get(paramLong);
if (i >= 0) {
return i / this.a;
}
return (i + 1) / this.a - 1;
}
public int getDifference(long paramLong1, long paramLong2)
{
return getWrappedField().getDifference(paramLong1, paramLong2) / this.a;
}
public long getDifferenceAsLong(long paramLong1, long paramLong2)
{
return getWrappedField().getDifferenceAsLong(paramLong1, paramLong2) / this.a;
}
public int getDivisor()
{
return this.a;
}
public DurationField getDurationField()
{
return this.b;
}
public int getMaximumValue()
{
return this.d;
}
public int getMinimumValue()
{
return this.c;
}
public long remainder(long paramLong)
{
return set(paramLong, get(getWrappedField().remainder(paramLong)));
}
public long roundFloor(long paramLong)
{
DateTimeField localDateTimeField = getWrappedField();
return localDateTimeField.roundFloor(localDateTimeField.set(paramLong, get(paramLong) * this.a));
}
public long set(long paramLong, int paramInt)
{
FieldUtils.verifyValueBounds(this, paramInt, this.c, this.d);
int i = getWrappedField().get(paramLong);
if (i >= 0) {
i %= this.a;
}
for (;;)
{
return getWrappedField().set(paramLong, i + this.a * paramInt);
int j = this.a;
i = (i + 1) % this.a + (j - 1);
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/field/DividedDateTimeField.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/