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