EMMA Coverage Report (generated Tue Oct 28 00:01:11 GMT 2008)
[all classes][org.joda.time.field]

COVERAGE SUMMARY FOR SOURCE FILE [DelegatedDateTimeField.java]

nameclass, %method, %block, %line, %
DelegatedDateTimeField.java100% (1/1)51%  (27/53)46%  (144/313)54%  (32/59)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DelegatedDateTimeField100% (1/1)51%  (27/53)46%  (144/313)54%  (32/59)
add (ReadablePartial, int, int [], int): int [] 0%   (0/1)0%   (0/8)0%   (0/1)
addWrapField (ReadablePartial, int, int [], int): int [] 0%   (0/1)0%   (0/8)0%   (0/1)
addWrapPartial (ReadablePartial, int, int [], int): int [] 0%   (0/1)0%   (0/8)0%   (0/1)
getAsShortText (ReadablePartial, Locale): String 0%   (0/1)0%   (0/6)0%   (0/1)
getAsShortText (ReadablePartial, int, Locale): String 0%   (0/1)0%   (0/7)0%   (0/1)
getAsShortText (int, Locale): String 0%   (0/1)0%   (0/6)0%   (0/1)
getAsShortText (long): String 0%   (0/1)0%   (0/5)0%   (0/1)
getAsShortText (long, Locale): String 0%   (0/1)0%   (0/6)0%   (0/1)
getAsText (ReadablePartial, Locale): String 0%   (0/1)0%   (0/6)0%   (0/1)
getAsText (ReadablePartial, int, Locale): String 0%   (0/1)0%   (0/7)0%   (0/1)
getAsText (int, Locale): String 0%   (0/1)0%   (0/6)0%   (0/1)
getAsText (long): String 0%   (0/1)0%   (0/5)0%   (0/1)
getAsText (long, Locale): String 0%   (0/1)0%   (0/6)0%   (0/1)
getDifferenceAsLong (long, long): long 0%   (0/1)0%   (0/6)0%   (0/1)
getMaximumShortTextLength (Locale): int 0%   (0/1)0%   (0/5)0%   (0/1)
getMaximumTextLength (Locale): int 0%   (0/1)0%   (0/5)0%   (0/1)
getMaximumValue (ReadablePartial): int 0%   (0/1)0%   (0/5)0%   (0/1)
getMinimumValue (ReadablePartial): int 0%   (0/1)0%   (0/5)0%   (0/1)
getName (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getWrappedField (): DateTimeField 0%   (0/1)0%   (0/3)0%   (0/1)
roundHalfCeiling (long): long 0%   (0/1)0%   (0/5)0%   (0/1)
set (ReadablePartial, int, int [], String, Locale): int [] 0%   (0/1)0%   (0/9)0%   (0/1)
set (ReadablePartial, int, int [], int): int [] 0%   (0/1)0%   (0/8)0%   (0/1)
set (long, String): long 0%   (0/1)0%   (0/6)0%   (0/1)
set (long, String, Locale): long 0%   (0/1)0%   (0/7)0%   (0/1)
toString (): String 0%   (0/1)0%   (0/12)0%   (0/1)
DelegatedDateTimeField (DateTimeField, DateTimeFieldType): void 100% (1/1)76%  (16/21)83%  (5/6)
DelegatedDateTimeField (DateTimeField): void 100% (1/1)100% (5/5)100% (2/2)
add (long, int): long 100% (1/1)100% (6/6)100% (1/1)
add (long, long): long 100% (1/1)100% (6/6)100% (1/1)
addWrapField (long, int): long 100% (1/1)100% (6/6)100% (1/1)
get (long): int 100% (1/1)100% (5/5)100% (1/1)
getDifference (long, long): int 100% (1/1)100% (6/6)100% (1/1)
getDurationField (): DurationField 100% (1/1)100% (4/4)100% (1/1)
getLeapAmount (long): int 100% (1/1)100% (5/5)100% (1/1)
getLeapDurationField (): DurationField 100% (1/1)100% (4/4)100% (1/1)
getMaximumValue (): int 100% (1/1)100% (4/4)100% (1/1)
getMaximumValue (ReadablePartial, int []): int 100% (1/1)100% (6/6)100% (1/1)
getMaximumValue (long): int 100% (1/1)100% (5/5)100% (1/1)
getMinimumValue (): int 100% (1/1)100% (4/4)100% (1/1)
getMinimumValue (ReadablePartial, int []): int 100% (1/1)100% (6/6)100% (1/1)
getMinimumValue (long): int 100% (1/1)100% (5/5)100% (1/1)
getRangeDurationField (): DurationField 100% (1/1)100% (4/4)100% (1/1)
getType (): DateTimeFieldType 100% (1/1)100% (3/3)100% (1/1)
isLeap (long): boolean 100% (1/1)100% (5/5)100% (1/1)
isLenient (): boolean 100% (1/1)100% (4/4)100% (1/1)
isSupported (): boolean 100% (1/1)100% (4/4)100% (1/1)
remainder (long): long 100% (1/1)100% (5/5)100% (1/1)
roundCeiling (long): long 100% (1/1)100% (5/5)100% (1/1)
roundFloor (long): long 100% (1/1)100% (5/5)100% (1/1)
roundHalfEven (long): long 100% (1/1)100% (5/5)100% (1/1)
roundHalfFloor (long): long 100% (1/1)100% (5/5)100% (1/1)
set (long, int): long 100% (1/1)100% (6/6)100% (1/1)

1/*
2 *  Copyright 2001-2005 Stephen Colebourne
3 *
4 *  Licensed under the Apache License, Version 2.0 (the "License");
5 *  you may not use this file except in compliance with the License.
6 *  You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 *  Unless required by applicable law or agreed to in writing, software
11 *  distributed under the License is distributed on an "AS IS" BASIS,
12 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 *  See the License for the specific language governing permissions and
14 *  limitations under the License.
15 */
16package org.joda.time.field;
17 
18import java.io.Serializable;
19import java.util.Locale;
20import org.joda.time.DateTimeField;
21import org.joda.time.DateTimeFieldType;
22import org.joda.time.DurationField;
23import org.joda.time.ReadablePartial;
24 
25/**
26 * <code>DelegatedDateTimeField</code> delegates each method call to the
27 * date time field it wraps.
28 * <p>
29 * DelegatedDateTimeField is thread-safe and immutable, and its subclasses must
30 * be as well.
31 *
32 * @author Brian S O'Neill
33 * @since 1.0
34 * @see DecoratedDateTimeField
35 */
36public class DelegatedDateTimeField extends DateTimeField implements Serializable {
37 
38    /** Serialization version */
39    private static final long serialVersionUID = -4730164440214502503L;
40 
41    /** The DateTimeField being wrapped */
42    private final DateTimeField iField;
43    /** The override field type */
44    private final DateTimeFieldType iType;
45 
46    /**
47     * Constructor.
48     * 
49     * @param field  the field being decorated
50     */
51    public DelegatedDateTimeField(DateTimeField field) {
52        this(field, null);
53    }
54 
55    /**
56     * Constructor.
57     * 
58     * @param field  the field being decorated
59     * @param type  the field type override
60     */
61    public DelegatedDateTimeField(DateTimeField field, DateTimeFieldType type) {
62        super();
63        if (field == null) {
64            throw new IllegalArgumentException("The field must not be null");
65        }
66        iField = field;
67        iType = (type == null ? field.getType() : type);
68    }
69 
70    /**
71     * Gets the wrapped date time field.
72     * 
73     * @return the wrapped DateTimeField
74     */
75    public final DateTimeField getWrappedField() {
76        return iField;
77    }
78 
79    public DateTimeFieldType getType() {
80        return iType;
81    }
82 
83    public String getName() {
84        return iType.getName();
85    }
86 
87    public boolean isSupported() {
88        return iField.isSupported();
89    }
90 
91    public boolean isLenient() {
92        return iField.isLenient();
93    }
94 
95    public int get(long instant) {
96        return iField.get(instant);
97    }
98 
99    public String getAsText(long instant, Locale locale) {
100        return iField.getAsText(instant, locale);
101    }
102 
103    public String getAsText(long instant) {
104        return iField.getAsText(instant);
105    }
106 
107    public String getAsText(ReadablePartial partial, int fieldValue, Locale locale) {
108        return iField.getAsText(partial, fieldValue, locale);
109    }
110 
111    public String getAsText(ReadablePartial partial, Locale locale) {
112        return iField.getAsText(partial, locale);
113    }
114 
115    public String getAsText(int fieldValue, Locale locale) {
116        return iField.getAsText(fieldValue, locale);
117    }
118 
119    public String getAsShortText(long instant, Locale locale) {
120        return iField.getAsShortText(instant, locale);
121    }
122 
123    public String getAsShortText(long instant) {
124        return iField.getAsShortText(instant);
125    }
126 
127    public String getAsShortText(ReadablePartial partial, int fieldValue, Locale locale) {
128        return iField.getAsShortText(partial, fieldValue, locale);
129    }
130 
131    public String getAsShortText(ReadablePartial partial, Locale locale) {
132        return iField.getAsShortText(partial, locale);
133    }
134 
135    public String getAsShortText(int fieldValue, Locale locale) {
136        return iField.getAsShortText(fieldValue, locale);
137    }
138 
139    public long add(long instant, int value) {
140        return iField.add(instant, value);
141    }
142 
143    public long add(long instant, long value) {
144        return iField.add(instant, value);
145    }
146 
147    public int[] add(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
148        return iField.add(instant, fieldIndex, values, valueToAdd);
149    }
150 
151    public int[] addWrapPartial(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
152        return iField.addWrapPartial(instant, fieldIndex, values, valueToAdd);
153    }
154 
155    public long addWrapField(long instant, int value) {
156        return iField.addWrapField(instant, value);
157    }
158 
159    public int[] addWrapField(ReadablePartial instant, int fieldIndex, int[] values, int valueToAdd) {
160        return iField.addWrapField(instant, fieldIndex, values, valueToAdd);
161    }
162 
163    public int getDifference(long minuendInstant, long subtrahendInstant) {
164        return iField.getDifference(minuendInstant, subtrahendInstant);
165    }
166 
167    public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) {
168        return iField.getDifferenceAsLong(minuendInstant, subtrahendInstant);
169    }
170 
171    public long set(long instant, int value) {
172        return iField.set(instant, value);
173    }
174 
175    public long set(long instant, String text, Locale locale) {
176        return iField.set(instant, text, locale);
177    }
178 
179    public long set(long instant, String text) {
180        return iField.set(instant, text);
181    }
182 
183    public int[] set(ReadablePartial instant, int fieldIndex, int[] values, int newValue) {
184        return iField.set(instant, fieldIndex, values, newValue);
185    }
186 
187    public int[] set(ReadablePartial instant, int fieldIndex, int[] values, String text, Locale locale) {
188        return iField.set(instant, fieldIndex, values, text, locale);
189    }
190 
191    public DurationField getDurationField() {
192        return iField.getDurationField();
193    }
194 
195    public DurationField getRangeDurationField() {
196        return iField.getRangeDurationField();
197    }
198 
199    public boolean isLeap(long instant) {
200        return iField.isLeap(instant);
201    }
202 
203    public int getLeapAmount(long instant) {
204        return iField.getLeapAmount(instant);
205    }
206 
207    public DurationField getLeapDurationField() {
208        return iField.getLeapDurationField();
209    }
210 
211    public int getMinimumValue() {
212        return iField.getMinimumValue();
213    }
214 
215    public int getMinimumValue(long instant) {
216        return iField.getMinimumValue(instant);
217    }
218 
219    public int getMinimumValue(ReadablePartial instant) {
220        return iField.getMinimumValue(instant);
221    }
222 
223    public int getMinimumValue(ReadablePartial instant, int[] values) {
224        return iField.getMinimumValue(instant, values);
225    }
226 
227    public int getMaximumValue() {
228        return iField.getMaximumValue();
229    }
230 
231    public int getMaximumValue(long instant) {
232        return iField.getMaximumValue(instant);
233    }
234 
235    public int getMaximumValue(ReadablePartial instant) {
236        return iField.getMaximumValue(instant);
237    }
238 
239    public int getMaximumValue(ReadablePartial instant, int[] values) {
240        return iField.getMaximumValue(instant, values);
241    }
242 
243    public int getMaximumTextLength(Locale locale) {
244        return iField.getMaximumTextLength(locale);
245    }
246 
247    public int getMaximumShortTextLength(Locale locale) {
248        return iField.getMaximumShortTextLength(locale);
249    }
250 
251    public long roundFloor(long instant) {
252        return iField.roundFloor(instant);
253    }
254 
255    public long roundCeiling(long instant) {
256        return iField.roundCeiling(instant);
257    }
258 
259    public long roundHalfFloor(long instant) {
260        return iField.roundHalfFloor(instant);
261    }
262 
263    public long roundHalfCeiling(long instant) {
264        return iField.roundHalfCeiling(instant);
265    }
266 
267    public long roundHalfEven(long instant) {
268        return iField.roundHalfEven(instant);
269    }
270 
271    public long remainder(long instant) {
272        return iField.remainder(instant);
273    }
274 
275    public String toString() {
276        return ("DateTimeField[" + getName() + ']');
277    }
278 
279}

[all classes][org.joda.time.field]
EMMA 2.0.5312 (C) Vladimir Roubtsov