1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.joda.time.field;
17
18 import org.joda.time.DurationField;
19 import org.joda.time.DurationFieldType;
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 public class DecoratedDurationField extends BaseDurationField {
39
40 private static final long serialVersionUID = 8019982251647420015L;
41
42
43 private final DurationField iField;
44
45
46
47
48
49
50
51 public DecoratedDurationField(DurationField field, DurationFieldType type) {
52 super(type);
53 if (field == null) {
54 throw new IllegalArgumentException("The field must not be null");
55 }
56 if (!field.isSupported()) {
57 throw new IllegalArgumentException("The field must be supported");
58 }
59 iField = field;
60 }
61
62
63
64
65
66
67
68 public final DurationField getWrappedField() {
69 return iField;
70 }
71
72 public boolean isPrecise() {
73 return iField.isPrecise();
74 }
75
76 public long getValueAsLong(long duration, long instant) {
77 return iField.getValueAsLong(duration, instant);
78 }
79
80 public long getMillis(int value, long instant) {
81 return iField.getMillis(value, instant);
82 }
83
84 public long getMillis(long value, long instant) {
85 return iField.getMillis(value, instant);
86 }
87
88 public long add(long instant, int value) {
89 return iField.add(instant, value);
90 }
91
92 public long add(long instant, long value) {
93 return iField.add(instant, value);
94 }
95
96 public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
97 return iField.getDifferenceAsLong(minuendInstant, subtrahendInstant);
98 }
99
100 public long getUnitMillis() {
101 return iField.getUnitMillis();
102 }
103
104 }