Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Mai 10 2007 03:16:40 CEST
file stats: LOC: 100   Methods: 9
NCLOC: 40   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
LatexVo.java 100% 100% 100% 100%
coverage
 1    /* $Id: LatexVo.java,v 1.8 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.Latex;
 21    import org.qedeq.kernel.utility.EqualsUtility;
 22   
 23   
 24    /**
 25    * LaTeX text part.
 26    *
 27    * @version $Revision: 1.8 $
 28    * @author Michael Meyling
 29    */
 30    public class LatexVo 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  5198 public LatexVo(final String language, final String latex) {
 45  5198 this.language = language;
 46  5198 this.latex = latex;
 47    }
 48   
 49    /**
 50    * Constructs an empty LaTeX text part.
 51    */
 52  5423 public LatexVo() {
 53    // nothing to do
 54    }
 55   
 56    /**
 57    * Set text language. Examples are <code>en</code>, <code>de</code>.
 58    *
 59    * @param language Language.
 60    */
 61  5410 public final void setLanguage(final String language) {
 62  5410 this.language = language;
 63    }
 64   
 65  24361 public final String getLanguage() {
 66  24361 return language;
 67    }
 68   
 69    /**
 70    * Set LaTeX text.
 71    *
 72    * @param latex LaTeX text.
 73    */
 74  5410 public final void setLatex(final String latex) {
 75  5410 this.latex = latex;
 76    }
 77   
 78  17554 public final String getLatex() {
 79  17554 return latex;
 80    }
 81   
 82  2131 public boolean equals(final Object obj) {
 83  2131 if (!(obj instanceof LatexVo)) {
 84  8 return false;
 85    }
 86  2123 final LatexVo other = (LatexVo) obj;
 87  2123 return EqualsUtility.equals(getLanguage(), other.getLanguage())
 88    && EqualsUtility.equals(getLatex(), other.getLatex());
 89    }
 90   
 91  1895 public int hashCode() {
 92  1895 return (getLanguage() != null ? getLanguage().hashCode() : 0)
 93  1895 ^ (getLatex() != null ? 1 ^ getLatex().hashCode() : 0);
 94    }
 95   
 96  1408 public String toString() {
 97  1408 return "\"" + getLanguage() + "\":" + getLatex();
 98    }
 99   
 100    }