Months.java
5.37 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
219
220
221
222
223
224
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 Months
extends BaseSingleFieldPeriod
{
public static final Months EIGHT;
public static final Months ELEVEN;
public static final Months FIVE;
public static final Months FOUR;
public static final Months MAX_VALUE = new Months(Integer.MAX_VALUE);
public static final Months MIN_VALUE = new Months(Integer.MIN_VALUE);
public static final Months NINE;
public static final Months ONE;
public static final Months SEVEN;
public static final Months SIX;
public static final Months TEN;
public static final Months THREE;
public static final Months TWELVE;
public static final Months TWO;
public static final Months ZERO = new Months(0);
private static final PeriodFormatter a = ISOPeriodFormat.standard().withParseType(PeriodType.months());
private static final long serialVersionUID = 87525275727380867L;
static
{
ONE = new Months(1);
TWO = new Months(2);
THREE = new Months(3);
FOUR = new Months(4);
FIVE = new Months(5);
SIX = new Months(6);
SEVEN = new Months(7);
EIGHT = new Months(8);
NINE = new Months(9);
TEN = new Months(10);
ELEVEN = new Months(11);
TWELVE = new Months(12);
}
private Months(int paramInt)
{
super(paramInt);
}
public static Months months(int paramInt)
{
switch (paramInt)
{
default:
return new Months(paramInt);
case 0:
return ZERO;
case 1:
return ONE;
case 2:
return TWO;
case 3:
return THREE;
case 4:
return FOUR;
case 5:
return FIVE;
case 6:
return SIX;
case 7:
return SEVEN;
case 8:
return EIGHT;
case 9:
return NINE;
case 10:
return TEN;
case 11:
return ELEVEN;
case 12:
return TWELVE;
case 2147483647:
return MAX_VALUE;
}
return MIN_VALUE;
}
public static Months monthsBetween(ReadableInstant paramReadableInstant1, ReadableInstant paramReadableInstant2)
{
return months(BaseSingleFieldPeriod.between(paramReadableInstant1, paramReadableInstant2, DurationFieldType.months()));
}
public static Months monthsBetween(ReadablePartial paramReadablePartial1, ReadablePartial paramReadablePartial2)
{
if (((paramReadablePartial1 instanceof LocalDate)) && ((paramReadablePartial2 instanceof LocalDate))) {
return months(DateTimeUtils.getChronology(paramReadablePartial1.getChronology()).months().getDifference(((LocalDate)paramReadablePartial2).getLocalMillis(), ((LocalDate)paramReadablePartial1).getLocalMillis()));
}
return months(BaseSingleFieldPeriod.between(paramReadablePartial1, paramReadablePartial2, ZERO));
}
public static Months monthsIn(ReadableInterval paramReadableInterval)
{
if (paramReadableInterval == null) {
return ZERO;
}
return months(BaseSingleFieldPeriod.between(paramReadableInterval.getStart(), paramReadableInterval.getEnd(), DurationFieldType.months()));
}
@FromString
public static Months parseMonths(String paramString)
{
if (paramString == null) {
return ZERO;
}
return months(a.parsePeriod(paramString).getMonths());
}
private Object readResolve()
{
return months(getValue());
}
public final Months dividedBy(int paramInt)
{
if (paramInt == 1) {
return this;
}
return months(getValue() / paramInt);
}
public final DurationFieldType getFieldType()
{
return DurationFieldType.months();
}
public final int getMonths()
{
return getValue();
}
public final PeriodType getPeriodType()
{
return PeriodType.months();
}
public final boolean isGreaterThan(Months paramMonths)
{
if (paramMonths == null) {
if (getValue() <= 0) {}
}
while (getValue() > paramMonths.getValue())
{
return true;
return false;
}
return false;
}
public final boolean isLessThan(Months paramMonths)
{
if (paramMonths == null) {
if (getValue() >= 0) {}
}
while (getValue() < paramMonths.getValue())
{
return true;
return false;
}
return false;
}
public final Months minus(int paramInt)
{
return plus(FieldUtils.safeNegate(paramInt));
}
public final Months minus(Months paramMonths)
{
if (paramMonths == null) {
return this;
}
return minus(paramMonths.getValue());
}
public final Months multipliedBy(int paramInt)
{
return months(FieldUtils.safeMultiply(getValue(), paramInt));
}
public final Months negated()
{
return months(FieldUtils.safeNegate(getValue()));
}
public final Months plus(int paramInt)
{
if (paramInt == 0) {
return this;
}
return months(FieldUtils.safeAdd(getValue(), paramInt));
}
public final Months plus(Months paramMonths)
{
if (paramMonths == null) {
return this;
}
return plus(paramMonths.getValue());
}
@ToString
public final String toString()
{
return "P" + String.valueOf(getValue()) + "M";
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/Months.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/