Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
31   193   27   1.72
18   98   0.87   18
18     1.5  
1    
 
  HeaderVo       Line # 33 31 27 100% 1.0
 
  (94)
 
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.AuthorList;
20    import org.qedeq.kernel.se.base.module.Header;
21    import org.qedeq.kernel.se.base.module.ImportList;
22    import org.qedeq.kernel.se.base.module.LatexList;
23    import org.qedeq.kernel.se.base.module.Specification;
24    import org.qedeq.kernel.se.base.module.UsedByList;
25   
26   
27    /**
28    * Header of a qedeq file. The header specifies such things as the location of the file,
29    * the title and abstract of that module, imports and exports.
30    *
31    * @author Michael Meyling
32    */
 
33    public class HeaderVo implements Header {
34   
35    /** Module specification. */
36    private Specification specification;
37   
38    /** Module title. */
39    private LatexList title;
40   
41    /** Module "abstract". */
42    private LatexList summary;
43   
44    /** Author list. */
45    private AuthorList authorList;
46   
47    /** List of imported modules. */
48    private ImportList importList;
49   
50    /** List of modules that depend on current one. */
51    private UsedByList usedByList;
52   
53    /** Email address of module administrator. */
54    private String email;
55   
56    /**
57    * Constructs a new module header.
58    */
 
59  1266 toggle public HeaderVo() {
60    // nothing to do
61    }
62   
63    /**
64    * Set module specification.
65    * @param specification Module specification.
66    */
 
67  1210 toggle public final void setSpecification(final SpecificationVo specification) {
68  1210 this.specification = specification;
69    }
70   
 
71  139033 toggle public final Specification getSpecification() {
72  139033 return specification;
73    }
74   
75    /**
76    * Set module title.
77    *
78    * @param title Module title texts.
79    */
 
80  1209 toggle public final void setTitle(final LatexListVo title) {
81  1209 this.title = title;
82    }
83   
 
84  139294 toggle public final LatexList getTitle() {
85  139294 return title;
86    }
87   
88    /**
89    * Set module summary text.
90    *
91    * @param summary Module summary text.
92    */
 
93  1209 toggle public final void setSummary(final LatexListVo summary) {
94  1209 this.summary = summary;
95    }
96   
 
97  138105 toggle public final LatexList getSummary() {
98  138105 return summary;
99    }
100   
101    /**
102    * Set list of authors of this module.
103    *
104    * @param authors Author list.
105    */
 
106  1210 toggle public final void setAuthorList(final AuthorListVo authors) {
107  1210 this.authorList = authors;
108    }
109   
 
110  137813 toggle public final AuthorList getAuthorList() {
111  137813 return authorList;
112    }
113   
114    /**
115    * Set list of imports needed for this module.
116    *
117    * @param imports Module import list.
118    */
 
119  762 toggle public final void setImportList(final ImportListVo imports) {
120  762 this.importList = imports;
121    }
122   
 
123  191266 toggle public final ImportList getImportList() {
124  191266 return importList;
125    }
126   
127    /**
128    * Set list of known modules that need this module.
129    *
130    * @param usedby List of modules.
131    */
 
132  312 toggle public final void setUsedByList(final UsedByListVo usedby) {
133  312 this.usedByList = usedby;
134    }
135   
 
136  96509 toggle public final UsedByList getUsedByList() {
137  96509 return usedByList;
138    }
139   
140    /**
141    * Set email address of module administrator.
142    *
143    * @param email Email address.
144    */
 
145  1208 toggle public final void setEmail(final String email) {
146  1208 this.email = email;
147    }
148   
 
149  2063 toggle public final String getEmail() {
150  2063 return email;
151    }
152   
 
153  131 toggle public boolean equals(final Object obj) {
154  131 if (!(obj instanceof HeaderVo)) {
155  12 return false;
156    }
157  119 final HeaderVo other = (HeaderVo) obj;
158  119 return EqualsUtility.equals(getSpecification(), other.getSpecification())
159    && EqualsUtility.equals(getTitle(), other.getTitle())
160    && EqualsUtility.equals(getSummary(), other.getSummary())
161    && EqualsUtility.equals(getAuthorList(), other.getAuthorList())
162    && EqualsUtility.equals(getImportList(), other.getImportList())
163    && EqualsUtility.equals(getUsedByList(), other.getUsedByList())
164    && EqualsUtility.equals(getEmail(), other.getEmail());
165    }
166   
 
167  128 toggle public int hashCode() {
168  128 return (getSpecification() != null ? getSpecification().hashCode() : 0)
169  128 ^ (getTitle() != null ? 1 ^ getTitle().hashCode() : 0)
170  128 ^ (getSummary() != null ? 2 ^ getSummary().hashCode() : 0)
171  128 ^ (getAuthorList() != null ? 3 ^ getAuthorList().hashCode() : 0)
172  128 ^ (getImportList() != null ? 4 ^ getImportList().hashCode() : 0)
173  128 ^ (getUsedByList() != null ? 5 ^ getUsedByList().hashCode() : 0)
174  128 ^ (getEmail() != null ? 6 ^ getEmail().hashCode() : 0);
175    }
176   
 
177  72 toggle public String toString() {
178  72 final StringBuffer buffer = new StringBuffer("Header\n");
179  72 buffer.append(getSpecification() + "\n");
180  72 buffer.append("Title: ");
181  72 buffer.append(getTitle() + "\n\n");
182  72 buffer.append("Abstract: ");
183  72 buffer.append(getSummary() + "\n\n");
184  72 buffer.append(getAuthorList() + "\n");
185  72 buffer.append(getImportList() + "\n");
186  72 buffer.append(getUsedByList() + "\n");
187  72 if (getEmail() != null) {
188  54 buffer.append("\nModule email: <" + getEmail() + ">");
189    }
190  72 return buffer.toString();
191    }
192   
193    }