Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Mai 10 2007 03:16:40 CEST
file stats: LOC: 134   Methods: 12
NCLOC: 63   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
SectionVo.java 100% 100% 100% 100%
coverage
 1    /* $Id: SectionVo.java,v 1.12 2007/05/10 00:37:50 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2007, 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.kernel.base.module.LatexList;
 21    import org.qedeq.kernel.base.module.Section;
 22    import org.qedeq.kernel.base.module.SubsectionList;
 23    import org.qedeq.kernel.utility.EqualsUtility;
 24   
 25   
 26    /**
 27    * Section of a qedeq file.
 28    *
 29    * @version $Revision: 1.12 $
 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  591 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  344 public final void setNoNumber(final Boolean noNumber) {
 59  344 this.noNumber = noNumber;
 60    }
 61   
 62  890 public final Boolean getNoNumber() {
 63  890 return noNumber;
 64    }
 65   
 66    /**
 67    * Set section title.
 68    *
 69    * @param title Section title.
 70    */
 71  568 public final void setTitle(final LatexListVo title) {
 72  568 this.title = title;
 73    }
 74   
 75  141095 public final LatexList getTitle() {
 76  141095 return title;
 77    }
 78   
 79    /**
 80    * Set LaTeX introduction text.
 81    *
 82    * @param introduction Introduction text.
 83    */
 84  561 public final void setIntroduction(final LatexListVo introduction) {
 85  561 this.introduction = introduction;
 86    }
 87   
 88  140065 public final LatexList getIntroduction() {
 89  140065 return introduction;
 90    }
 91   
 92    /**
 93    * Set list of subsections of this section.
 94    *
 95    * @param subsections List of subsections.
 96    */
 97  342 public final void setSubsectionList(final SubsectionListVo subsections) {
 98  342 this.subsectionList = subsections;
 99    }
 100   
 101  153596 public final SubsectionList getSubsectionList() {
 102  153596 return subsectionList;
 103    }
 104   
 105  178 public boolean equals(final Object obj) {
 106  178 if (!(obj instanceof SectionVo)) {
 107  8 return false;
 108    }
 109  170 final SectionVo other = (SectionVo) obj;
 110  170 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  158 public int hashCode() {
 117  158 return (getNoNumber() != null ? getNoNumber().hashCode() : 0)
 118  158 ^ (getTitle() != null ? 1 ^ getTitle().hashCode() : 0)
 119  158 ^ (getIntroduction() != null ? 2 ^ getIntroduction().hashCode() : 0)
 120  158 ^ (getSubsectionList() != null ? 3 ^ getSubsectionList().hashCode() : 0);
 121    }
 122   
 123  130 public String toString() {
 124  130 final StringBuffer buffer = new StringBuffer();
 125  130 buffer.append("Section noNumbering: " + noNumber + "\n");
 126  130 buffer.append("Section Title: \n");
 127  130 buffer.append(getTitle() + "\n\n");
 128  130 buffer.append("Introduction: ");
 129  130 buffer.append(getIntroduction() + "\n\n");
 130  130 buffer.append(getSubsectionList() + "\n");
 131  130 return buffer.toString();
 132    }
 133   
 134    }