Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Sa Okt 21 2006 08:24:31 CEST
file stats: LOC: 100   Methods: 9
NCLOC: 40   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
LatexBo.java 100% 100% 100% 100%
coverage
 1    /* $Id: LatexBo.java,v 1.4 2006/10/20 20:23:00 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.bo.module;
 19   
 20    import org.qedeq.kernel.base.module.Latex;
 21    import org.qedeq.kernel.utility.EqualsUtility;
 22   
 23   
 24    /**
 25    * LaTeX text part.
 26    *
 27    * @version $Revision: 1.4 $
 28    * @author Michael Meyling
 29    */
 30    public final class LatexBo implements Latex {
 31   
 32    /** Text language. */
 33    private String language;
 34   
 35    /** LaTeX text. */
 36    private String latex;
 37   
 38    /**
 39    * Constructs a LaTeX text part.
 40    *
 41    * @param language Language of this part.
 42    * @param latex LaTeX text.
 43    */
 44  6 public LatexBo(final String language, final String latex) {
 45  6 this.language = language;
 46  6 this.latex = latex;
 47    }
 48   
 49    /**
 50    * Constructs an empty LaTeX text part.
 51    */
 52  3128 public LatexBo() {
 53    // nothing to do
 54    }
 55   
 56    /**
 57    * Set language of this text.
 58    *
 59    * @param language Text language.
 60    */
 61  3115 public final void setLanguage(final String language) {
 62  3115 this.language = language;
 63    }
 64   
 65  10677 public final String getLanguage() {
 66  10677 return language;
 67    }
 68   
 69    /**
 70    * Set LaTeX content.
 71    *
 72    * @param latex LaTeX content.
 73    */
 74  3115 public final void setLatex(final String latex) {
 75  3115 this.latex = latex;
 76    }
 77   
 78  8363 public final String getLatex() {
 79  8363 return latex;
 80    }
 81   
 82  1674 public boolean equals(final Object obj) {
 83  1674 if (!(obj instanceof LatexBo)) {
 84  7 return false;
 85    }
 86  1667 final LatexBo other = (LatexBo) obj;
 87  1667 return EqualsUtility.equals(getLanguage(), other.getLanguage())
 88    && EqualsUtility.equals(getLatex(), other.getLatex());
 89    }
 90   
 91  1581 public int hashCode() {
 92  1581 return (getLanguage() != null ? getLanguage().hashCode() : 0)
 93  1581 ^ (getLatex() != null ? 1 ^ getLatex().hashCode() : 0);
 94    }
 95   
 96  1170 public String toString() {
 97  1170 return "\"" + getLanguage() + "\":" + getLatex();
 98    }
 99   
 100    }