Clover Coverage Report
Coverage timestamp: Sat Sep 18 2010 04:09:52 UTC
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
21   132   13   1.75
10   63   0.62   12
12     1.08  
1    
 
  SectionVo       Line # 30 21 13 100% 1.0
 
  (45)
 
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.LatexList;
20    import org.qedeq.kernel.base.module.Section;
21    import org.qedeq.kernel.base.module.SubsectionList;
22   
23   
24    /**
25    * Section of a qedeq file.
26    *
27    * @version $Revision: 1.14 $
28    * @author Michael Meyling
29    */
 
30    public class SectionVo implements Section {
31   
32    /** No section number. */
33    private Boolean noNumber;
34   
35    /** Section title. */
36    private LatexList title;
37   
38    /** Section introduction. */
39    private LatexList introduction;
40   
41    /** All subsections of this section.*/
42    private SubsectionList subsectionList;
43   
44    /**
45    * Constructs a new section.
46    */
 
47  919 toggle public SectionVo() {
48    // nothing to do
49    }
50   
51    /**
52    * Set no auto numbering for this section.
53    *
54    * @param noNumber Should this section be not numbered?
55    */
 
56  502 toggle public final void setNoNumber(final Boolean noNumber) {
57  502 this.noNumber = noNumber;
58    }
59   
 
60  1152 toggle public final Boolean getNoNumber() {
61  1152 return noNumber;
62    }
63   
64    /**
65    * Set section title.
66    *
67    * @param title Section title.
68    */
 
69  896 toggle public final void setTitle(final LatexListVo title) {
70  896 this.title = title;
71    }
72   
 
73  158653 toggle public final LatexList getTitle() {
74  158653 return title;
75    }
76   
77    /**
78    * Set LaTeX introduction text.
79    *
80    * @param introduction Introduction text.
81    */
 
82  889 toggle public final void setIntroduction(final LatexListVo introduction) {
83  889 this.introduction = introduction;
84    }
85   
 
86  157659 toggle public final LatexList getIntroduction() {
87  157659 return introduction;
88    }
89   
90    /**
91    * Set list of subsections of this section.
92    *
93    * @param subsections List of subsections.
94    */
 
95  590 toggle public final void setSubsectionList(final SubsectionListVo subsections) {
96  590 this.subsectionList = subsections;
97    }
98   
 
99  175147 toggle public final SubsectionList getSubsectionList() {
100  175147 return subsectionList;
101    }
102   
 
103  165 toggle public boolean equals(final Object obj) {
104  165 if (!(obj instanceof SectionVo)) {
105  8 return false;
106    }
107  157 final SectionVo other = (SectionVo) obj;
108  157 return EqualsUtility.equals(getNoNumber(), other.getNoNumber())
109    && EqualsUtility.equals(getTitle(), other.getTitle())
110    && EqualsUtility.equals(getIntroduction(), other.getIntroduction())
111    && EqualsUtility.equals(getSubsectionList(), other.getSubsectionList());
112    }
113   
 
114  212 toggle public int hashCode() {
115  212 return (getNoNumber() != null ? getNoNumber().hashCode() : 0)
116  212 ^ (getTitle() != null ? 1 ^ getTitle().hashCode() : 0)
117  212 ^ (getIntroduction() != null ? 2 ^ getIntroduction().hashCode() : 0)
118  212 ^ (getSubsectionList() != null ? 3 ^ getSubsectionList().hashCode() : 0);
119    }
120   
 
121  172 toggle public String toString() {
122  172 final StringBuffer buffer = new StringBuffer();
123  172 buffer.append("Section noNumbering: " + noNumber + "\n");
124  172 buffer.append("Section Title: \n");
125  172 buffer.append(getTitle() + "\n\n");
126  172 buffer.append("Introduction: ");
127  172 buffer.append(getIntroduction() + "\n\n");
128  172 buffer.append(getSubsectionList() + "\n");
129  172 return buffer.toString();
130    }
131   
132    }