Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
12   100   12   1.33
6   41   1   9
9     1.33  
1    
 
  ImportVo       Line # 28 12 12 100% 1.0
 
  (58)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, 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.se.dto.module;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19    import org.qedeq.kernel.se.base.module.Import;
20    import 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    */
 
28    public 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  499 toggle public ImportVo(final String label, final SpecificationVo specification) {
44  499 this.label = label;
45  499 this.specification = specification;
46    }
47   
48    /**
49    * Constructs an empty import.
50    */
 
51  545 toggle 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  528 toggle public final void setLabel(final String label) {
62  528 this.label = label;
63    }
64   
 
65  3867 toggle public final String getLabel() {
66  3867 return label;
67    }
68   
69    /**
70    * Set specification of this imported module. Contains location information.
71    *
72    * @param specification Module specification.
73    */
 
74  531 toggle public final void setSpecification(final SpecificationVo specification) {
75  531 this.specification = specification;
76    }
77   
 
78  4572 toggle public final Specification getSpecification() {
79  4572 return specification;
80    }
81   
 
82  104 toggle public boolean equals(final Object obj) {
83  104 if (!(obj instanceof ImportVo)) {
84  5 return false;
85    }
86  99 final ImportVo other = (ImportVo) obj;
87  99 return EqualsUtility.equals(getLabel(), other.getLabel())
88    && EqualsUtility.equals(getSpecification(), other.getSpecification());
89    }
90   
 
91  130 toggle public int hashCode() {
92  130 return (getLabel() != null ? getLabel().hashCode() : 0)
93  130 ^ (getSpecification() != null ? 1 ^ getSpecification().hashCode() : 0);
94    }
95   
 
96  89 toggle public String toString() {
97  89 return label + ":" + specification;
98    }
99   
100    }