EMMA Coverage Report (generated Fri Feb 14 08:28:31 UTC 2014)
[all classes][org.qedeq.kernel.se.dto.module]

COVERAGE SUMMARY FOR SOURCE FILE [ImportVo.java]

nameclass, %method, %block, %line, %
ImportVo.java100% (1/1)100% (9/9)100% (83/83)100% (18/18)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ImportVo100% (1/1)100% (9/9)100% (83/83)100% (18/18)
ImportVo (): void 100% (1/1)100% (3/3)100% (2/2)
ImportVo (String, SpecificationVo): void 100% (1/1)100% (9/9)100% (4/4)
equals (Object): boolean 100% (1/1)100% (24/24)100% (4/4)
getLabel (): String 100% (1/1)100% (3/3)100% (1/1)
getSpecification (): Specification 100% (1/1)100% (3/3)100% (1/1)
hashCode (): int 100% (1/1)100% (20/20)100% (1/1)
setLabel (String): void 100% (1/1)100% (4/4)100% (2/2)
setSpecification (SpecificationVo): void 100% (1/1)100% (4/4)100% (2/2)
toString (): String 100% (1/1)100% (13/13)100% (1/1)

1/* This file is part of the project "Hilbert II" - http://www.qedeq.org
2 *
3 * Copyright 2000-2014,  Michael Meyling <mime@qedeq.org>.
4 *
5 * "Hilbert II" is free software; you can redistribute
6 * it and/or modify it under the terms of the GNU General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15 
16package org.qedeq.kernel.se.dto.module;
17 
18import org.qedeq.base.utility.EqualsUtility;
19import org.qedeq.kernel.se.base.module.Import;
20import org.qedeq.kernel.se.base.module.Specification;
21 
22 
23/**
24 * Module import. Every needed module must be referenced as an module import.
25 *
26 * @author  Michael Meyling
27 */
28public class ImportVo implements Import {
29 
30    /** Label for the imported module. All references to that module must have this prefix. */
31    private String label;
32 
33    /** Specification of imported module. Includes location information. */
34    private Specification specification;
35 
36    /**
37     * Constructs a new import.
38     *
39     * @param   label           Label for this import. All references to that module must
40     *                          have this prefix.
41     * @param   specification   Import specification. Includes location information.
42     */
43    public ImportVo(final String label, final SpecificationVo specification) {
44        this.label = label;
45        this.specification = specification;
46    }
47 
48    /**
49     * Constructs an empty import.
50     */
51    public ImportVo() {
52        // nothing to do
53    }
54 
55    /**
56     * Set label for this import module. All references to this module must have this
57     * prefix.
58     *
59     * @param   label   Prefix for this imported module.
60     */
61    public final void setLabel(final String label) {
62        this.label = label;
63    }
64 
65    public final String getLabel() {
66        return label;
67    }
68 
69    /**
70     * Set specification of this imported module. Contains location information.
71     *
72     * @param   specification   Module specification.
73     */
74    public final void setSpecification(final SpecificationVo specification) {
75        this.specification = specification;
76    }
77 
78    public final Specification getSpecification() {
79        return specification;
80    }
81 
82    public boolean equals(final Object obj) {
83        if (!(obj instanceof ImportVo)) {
84            return false;
85        }
86        final ImportVo other = (ImportVo) obj;
87        return  EqualsUtility.equals(getLabel(), other.getLabel())
88            &&  EqualsUtility.equals(getSpecification(), other.getSpecification());
89    }
90 
91    public int hashCode() {
92        return (getLabel() != null ? getLabel().hashCode() : 0)
93            ^ (getSpecification() != null ? 1 ^ getSpecification().hashCode() : 0);
94    }
95 
96    public String toString() {
97        return label + ":" + specification;
98    }
99 
100}

[all classes][org.qedeq.kernel.se.dto.module]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov