Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
24   140   19   1.71
10   70   0.79   14
14     1.36  
1    
 
  SubsectionVo       Line # 29 24 19 100% 1.0
 
  (105)
 
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.LatexList;
20    import org.qedeq.kernel.se.base.module.Node;
21    import org.qedeq.kernel.se.base.module.Subsection;
22   
23   
24    /**
25    * Subsection of a qedeq file.
26    *
27    * @author Michael Meyling
28    */
 
29    public class SubsectionVo implements Subsection {
30   
31    /** Label for referencing. */
32    private String id;
33   
34    /** Level of that subsection. Higher levels contain additional informations. */
35    private String level;
36   
37    /** Title of this subsection. */
38    private LatexList title;
39   
40    /** LaTeX text. */
41    private LatexList latex;
42   
43    /**
44    * Constructs a new empty subsection.
45    */
 
46  2875 toggle public SubsectionVo() {
47    // nothing to do
48    }
49   
 
50  1 toggle public Node getNode() {
51  1 return null;
52    }
53   
 
54  3707 toggle public Subsection getSubsection() {
55  3707 return this;
56    }
57   
58    /**
59    * Set label for this subsection.
60    *
61    * @param label Label for referencing.
62    */
 
63  1132 toggle public final void setId(final String label) {
64  1132 this.id = label;
65    }
66   
 
67  10134 toggle public final String getId() {
68  10134 return id;
69    }
70   
71    /**
72    * Set level for this section. Higher levels contain additional informations
73    *
74    * @param level Level of that subsection.
75    */
 
76  1122 toggle public final void setLevel(final String level) {
77  1122 this.level = level;
78    }
79   
 
80  1407 toggle public final String getLevel() {
81  1407 return level;
82    }
83   
84    /**
85    * Set title of this subsection.
86    *
87    * @param title Subsection title.
88    */
 
89  486 toggle public final void setTitle(final LatexListVo title) {
90  486 this.title = title;
91    }
92   
 
93  24283 toggle public final LatexList getTitle() {
94  24283 return title;
95    }
96   
97    /**
98    * Set LaTeX text for this subsection.
99    *
100    * @param latexText LaTeX text.
101    */
 
102  2228 toggle public final void setLatex(final LatexListVo latexText) {
103  2228 this.latex = latexText;
104    }
105   
 
106  19950 toggle public final LatexList getLatex() {
107  19950 return latex;
108    }
109   
 
110  58 toggle public boolean equals(final Object obj) {
111  58 if (!(obj instanceof SubsectionVo)) {
112  6 return false;
113    }
114  52 final SubsectionVo subsection = (SubsectionVo) obj;
115  52 return EqualsUtility.equals(getId(), subsection.getId())
116    && EqualsUtility.equals(getLevel(), subsection.getLevel())
117    && EqualsUtility.equals(getTitle(), subsection.getTitle())
118    && EqualsUtility.equals(getLatex(), subsection.getLatex());
119    }
120   
 
121  62 toggle public int hashCode() {
122  62 return (getId() != null ? getId().hashCode() : 0)
123  62 ^ (getLevel() != null ? 1 ^ getLevel().hashCode() : 0)
124  62 ^ (getTitle() != null ? 2 ^ getTitle().hashCode() : 0)
125  62 ^ (getLatex() != null ? 3 ^ getLatex().hashCode() : 0);
126    }
127   
 
128  40 toggle public String toString() {
129  40 final StringBuffer buffer = new StringBuffer();
130  40 buffer.append("Subsection\t");
131  40 buffer.append("Label: " + getId());
132  40 buffer.append("\tLevel: " + getLevel() + "\n");
133  40 buffer.append("Title: ");
134  40 buffer.append(getTitle() + "\n\n");
135  40 buffer.append("Pre: ");
136  40 buffer.append(getLatex() + "\n\n");
137  40 return buffer.toString();
138    }
139   
140    }