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

COVERAGE SUMMARY FOR SOURCE FILE [DateConverter.java]

nameclass, %method, %block, %line, %
DateConverter.java100% (1/1)100% (4/4)100% (23/23)100% (6/6)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DateConverter100% (1/1)100% (4/4)100% (23/23)100% (6/6)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
DateConverter (): void 100% (1/1)100% (3/3)100% (2/2)
getInstantMillis (Object, Chronology): long 100% (1/1)100% (6/6)100% (2/2)
getSupportedType (): Class 100% (1/1)100% (9/9)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.convert;
17 
18import java.util.Date;
19 
20import org.joda.time.Chronology;
21 
22/**
23 * DateConverter converts a java util Date to an instant or partial.
24 * The Date is converted to milliseconds in the ISO chronology.
25 *
26 * @author Stephen Colebourne
27 * @since 1.0
28 */
29final class DateConverter extends AbstractConverter
30        implements InstantConverter, PartialConverter {
31 
32    /**
33     * Singleton instance.
34     */
35    static final DateConverter INSTANCE = new DateConverter();
36 
37    /**
38     * Restricted constructor.
39     */
40    protected DateConverter() {
41        super();
42    }
43 
44    //-----------------------------------------------------------------------
45    /**
46     * Gets the millis, which is the Date millis value.
47     * 
48     * @param object  the Date to convert, must not be null
49     * @param chrono  the non-null result of getChronology
50     * @return the millisecond value
51     * @throws NullPointerException if the object is null
52     * @throws ClassCastException if the object is an invalid type
53     */
54    public long getInstantMillis(Object object, Chronology chrono) {
55        Date date = (Date) object;
56        return date.getTime();
57    }
58 
59    //-----------------------------------------------------------------------
60    /**
61     * Returns Date.class.
62     * 
63     * @return Date.class
64     */
65    public Class getSupportedType() {
66        return Date.class;
67    }
68 
69}

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