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

COVERAGE SUMMARY FOR SOURCE FILE [LongConverter.java]

nameclass, %method, %block, %line, %
LongConverter.java100% (1/1)100% (5/5)100% (25/25)100% (6/6)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class LongConverter100% (1/1)100% (5/5)100% (25/25)100% (6/6)
<static initializer> 100% (1/1)100% (5/5)100% (1/1)
LongConverter (): void 100% (1/1)100% (3/3)100% (2/2)
getDurationMillis (Object): long 100% (1/1)100% (4/4)100% (1/1)
getInstantMillis (Object, Chronology): long 100% (1/1)100% (4/4)100% (1/1)
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 org.joda.time.Chronology;
19 
20/**
21 * LongConverter converts a Long to an instant, partial or duration.
22 * The Long value represents milliseconds in the ISO chronology.
23 *
24 * @author Stephen Colebourne
25 * @author Brian S O'Neill
26 * @since 1.0
27 */
28class LongConverter extends AbstractConverter
29        implements InstantConverter, PartialConverter, DurationConverter {
30 
31    /**
32     * Singleton instance.
33     */
34    static final LongConverter INSTANCE = new LongConverter();
35 
36    /**
37     * Restricted constructor.
38     */
39    protected LongConverter() {
40        super();
41    }
42 
43    //-----------------------------------------------------------------------
44    /**
45     * Gets the millisecond instant, which is the Long value.
46     * 
47     * @param object  the Long to convert, must not be null
48     * @param chrono  the chronology to use, which is always non-null
49     * @return the millisecond value
50     * @throws NullPointerException if the object is null
51     * @throws ClassCastException if the object is an invalid type
52     */
53    public long getInstantMillis(Object object, Chronology chrono) {
54        return ((Long) object).longValue();
55    }
56 
57    //-----------------------------------------------------------------------
58    /**
59     * Gets the millisecond duration, which is the Long value.
60     * 
61     * @param object  the Long to convert, must not be null
62     * @return the millisecond duration
63     * @throws NullPointerException if the object is null
64     * @throws ClassCastException if the object is an invalid type
65     */
66    public long getDurationMillis(Object object) {
67        return ((Long) object).longValue();
68    }
69 
70    //-----------------------------------------------------------------------
71    /**
72     * Returns Long.class.
73     * 
74     * @return Long.class
75     */
76    public Class getSupportedType() {
77        return Long.class;
78    }
79 
80}

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