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