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
SubsectionVo.java 100% 100% 100% 100%
coverage
 1    /* $Id: SubsectionVo.java,v 1.4 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.Subsection;
 22    import org.qedeq.kernel.utility.EqualsUtility;
 23   
 24   
 25    /**
 26    * Subsection of a qedeq file.
 27    *
 28    * @version $Revision: 1.4 $
 29    * @author Michael Meyling
 30    */
 31    public final class SubsectionVo implements Subsection {
 32   
 33    /** Label for referencing. */
 34    private String id;
 35   
 36    /** Level of that subsection. Higher levels contain additional informations. */
 37    private String level;
 38   
 39    /** Title of this subsection. */
 40    private LatexList title;
 41   
 42    /** LaTeX text. */
 43    private LatexList latex;
 44   
 45    /**
 46    * Constructs a new empty subsection.
 47    */
 48  188 public SubsectionVo() {
 49    // nothing to do
 50    }
 51   
 52    /**
 53    * Set label for this subsection.
 54    *
 55    * @param label Label for referencing.
 56    */
 57  77 public final void setId(final String label) {
 58  77 this.id = label;
 59    }
 60   
 61  217 public final String getId() {
 62  217 return id;
 63    }
 64   
 65    /**
 66    * Set level for this section. Higher levels contain additional informations
 67    *
 68    * @param level Level of that subsection.
 69    */
 70  77 public final void setLevel(final String level) {
 71  77 this.level = level;
 72    }
 73   
 74  260 public final String getLevel() {
 75  260 return level;
 76    }
 77   
 78    /**
 79    * Set title of this subsection.
 80    *
 81    * @param title Subsection title.
 82    */
 83  120 public final void setTitle(final LatexListVo title) {
 84  120 this.title = title;
 85    }
 86   
 87  540 public final LatexList getTitle() {
 88  540 return title;
 89    }
 90   
 91    /**
 92    * Set LaTeX text for this subsection.
 93    *
 94    * @param latexText LaTeX text.
 95    */
 96  138 public final void setLatex(final LatexListVo latexText) {
 97  138 this.latex = latexText;
 98    }
 99   
 100  507 public final LatexList getLatex() {
 101  507 return latex;
 102    }
 103   
 104  57 public boolean equals(final Object obj) {
 105  57 if (!(obj instanceof SubsectionVo)) {
 106  6 return false;
 107    }
 108  51 final SubsectionVo subsection = (SubsectionVo) obj;
 109  51 return EqualsUtility.equals(getId(), subsection.getId())
 110    && EqualsUtility.equals(getLevel(), subsection.getLevel())
 111    && EqualsUtility.equals(getTitle(), subsection.getTitle())
 112    && EqualsUtility.equals(getLatex(), subsection.getLatex());
 113    }
 114   
 115  58 public int hashCode() {
 116  58 return (getId() != null ? getId().hashCode() : 0)
 117  58 ^ (getLevel() != null ? 1 ^ getLevel().hashCode() : 0)
 118  58 ^ (getTitle() != null ? 2 ^ getTitle().hashCode() : 0)
 119  58 ^ (getLatex() != null ? 3 ^ getLatex().hashCode() : 0);
 120    }
 121   
 122  36 public String toString() {
 123  36 final StringBuffer buffer = new StringBuffer();
 124  36 buffer.append("Subsection\t");
 125  36 buffer.append("Label: " + getId());
 126  36 buffer.append("\tLevel: " + getLevel() + "\n");
 127  36 buffer.append("Title: ");
 128  36 buffer.append(getTitle() + "\n\n");
 129  36 buffer.append("Pre: ");
 130  36 buffer.append(getLatex() + "\n\n");
 131  36 return buffer.toString();
 132    }
 133   
 134    }