Clover Coverage Report
Coverage timestamp: Sat Sep 18 2010 04:09:52 UTC
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
12   101   10   1.33
6   41   0.83   9
9     1.11  
1    
 
  ImportVo       Line # 29 12 10 100% 1.0
 
  (46)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2010, 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   
16    package org.qedeq.kernel.dto.module;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19    import org.qedeq.kernel.base.module.Import;
20    import org.qedeq.kernel.base.module.Specification;
21   
22   
23    /**
24    * Module import. Every needed module must be referenced as an module import.
25    *
26    * @version $Revision: 1.9 $
27    * @author Michael Meyling
28    */
 
29    public class ImportVo implements Import {
30   
31    /** Label for the imported module. All references to that module must have this prefix. */
32    private String label;
33   
34    /** Specification of imported module. Includes location information. */
35    private Specification specification;
36   
37    /**
38    * Constructs a new import.
39    *
40    * @param label Label for this import. All references to that module must
41    * have this prefix.
42    * @param specification Import specification. Includes location information.
43    */
 
44  169 toggle public ImportVo(final String label, final SpecificationVo specification) {
45  169 this.label = label;
46  169 this.specification = specification;
47    }
48   
49    /**
50    * Constructs an empty import.
51    */
 
52  212 toggle public ImportVo() {
53    // nothing to do
54    }
55   
56    /**
57    * Set label for this import module. All references to this module must have this
58    * prefix.
59    *
60    * @param label Prefix for this imported module.
61    */
 
62  199 toggle public final void setLabel(final String label) {
63  199 this.label = label;
64    }
65   
 
66  1042 toggle public final String getLabel() {
67  1042 return label;
68    }
69   
70    /**
71    * Set specification of this imported module. Contains location information.
72    *
73    * @param specification Module specification.
74    */
 
75  199 toggle public final void setSpecification(final SpecificationVo specification) {
76  199 this.specification = specification;
77    }
78   
 
79  2026 toggle public final Specification getSpecification() {
80  2026 return specification;
81    }
82   
 
83  104 toggle public boolean equals(final Object obj) {
84  104 if (!(obj instanceof ImportVo)) {
85  5 return false;
86    }
87  99 final ImportVo other = (ImportVo) obj;
88  99 return EqualsUtility.equals(getLabel(), other.getLabel())
89    && EqualsUtility.equals(getSpecification(), other.getSpecification());
90    }
91   
 
92  129 toggle public int hashCode() {
93  129 return (getLabel() != null ? getLabel().hashCode() : 0)
94  129 ^ (getSpecification() != null ? 1 ^ getSpecification().hashCode() : 0);
95    }
96   
 
97  88 toggle public String toString() {
98  88 return label + ":" + specification;
99    }
100   
101    }