Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Jan 11 2007 09:03:50 CET
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.9 2006/10/20 20:23:01 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2006, 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.9 $
 30    * @author Michael Meyling
 31    */
 32    public final 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  369 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  221 public final void setNoNumber(final Boolean noNumber) {
 59  221 this.noNumber = noNumber;
 60    }
 61   
 62  744 public final Boolean getNoNumber() {
 63  744 return noNumber;
 64    }
 65   
 66    /**
 67    * Set section title.
 68    *
 69    * @param title Section title.
 70    */
 71  346 public final void setTitle(final LatexListVo title) {
 72  346 this.title = title;
 73    }
 74   
 75  1381 public final LatexList getTitle() {
 76  1381 return title;
 77    }
 78   
 79    /**
 80    * Set LaTeX introduction text.
 81    *
 82    * @param introduction Introduction text.
 83    */
 84  345 public final void setIntroduction(final LatexListVo introduction) {
 85  345 this.introduction = introduction;
 86    }
 87   
 88  1349 public final LatexList getIntroduction() {
 89  1349 return introduction;
 90    }
 91   
 92    /**
 93    * Set list of subsections of this section.
 94    *
 95    * @param subsections List of subsections.
 96    */
 97  214 public final void setSubsectionList(final SubsectionListVo subsections) {
 98  214 this.subsectionList = subsections;
 99    }
 100   
 101  3342 public final SubsectionList getSubsectionList() {
 102  3342 return subsectionList;
 103    }
 104   
 105  171 public boolean equals(final Object obj) {
 106  171 if (!(obj instanceof SectionVo)) {
 107  8 return false;
 108    }
 109  163 final SectionVo other = (SectionVo) obj;
 110  163 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  156 public int hashCode() {
 117  156 return (getNoNumber() != null ? getNoNumber().hashCode() : 0)
 118  156 ^ (getTitle() != null ? 1 ^ getTitle().hashCode() : 0)
 119  156 ^ (getIntroduction() != null ? 2 ^ getIntroduction().hashCode() : 0)
 120  156 ^ (getSubsectionList() != null ? 3 ^ getSubsectionList().hashCode() : 0);
 121    }
 122   
 123  128 public String toString() {
 124  128 final StringBuffer buffer = new StringBuffer();
 125  128 buffer.append("Section noNumbering: " + noNumber + "\n");
 126  128 buffer.append("Section Title: \n");
 127  128 buffer.append(getTitle() + "\n\n");
 128  128 buffer.append("Introduction: ");
 129  128 buffer.append(getIntroduction() + "\n\n");
 130  128 buffer.append(getSubsectionList() + "\n");
 131  128 return buffer.toString();
 132    }
 133   
 134    }