BaseDurationField.java
1.96 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
package org.joda.time.field;
import java.io.Serializable;
import org.joda.time.DurationField;
import org.joda.time.DurationFieldType;
public abstract class BaseDurationField
extends DurationField
implements Serializable
{
private static final long serialVersionUID = -2554245107589433218L;
private final DurationFieldType a;
protected BaseDurationField(DurationFieldType paramDurationFieldType)
{
if (paramDurationFieldType == null) {
throw new IllegalArgumentException("The type must not be null");
}
this.a = paramDurationFieldType;
}
public int compareTo(DurationField paramDurationField)
{
long l1 = paramDurationField.getUnitMillis();
long l2 = getUnitMillis();
if (l2 == l1) {
return 0;
}
if (l2 < l1) {
return -1;
}
return 1;
}
public int getDifference(long paramLong1, long paramLong2)
{
return FieldUtils.safeToInt(getDifferenceAsLong(paramLong1, paramLong2));
}
public long getMillis(int paramInt)
{
return paramInt * getUnitMillis();
}
public long getMillis(long paramLong)
{
return FieldUtils.safeMultiply(paramLong, getUnitMillis());
}
public final String getName()
{
return this.a.getName();
}
public final DurationFieldType getType()
{
return this.a;
}
public int getValue(long paramLong)
{
return FieldUtils.safeToInt(getValueAsLong(paramLong));
}
public int getValue(long paramLong1, long paramLong2)
{
return FieldUtils.safeToInt(getValueAsLong(paramLong1, paramLong2));
}
public long getValueAsLong(long paramLong)
{
return paramLong / getUnitMillis();
}
public final boolean isSupported()
{
return true;
}
public String toString()
{
return "DurationField[" + getName() + ']';
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/field/BaseDurationField.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/