Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Jan 11 2007 09:03:50 CET
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.5 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.Latex;
 21    import org.qedeq.kernel.utility.EqualsUtility;
 22   
 23   
 24    /**
 25    * LaTeX text part.
 26    *
 27    * @version $Revision: 1.5 $
 28    * @author Michael Meyling
 29    */
 30    public final 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  2631 public LatexVo(final String language, final String latex) {
 45  2631 this.language = language;
 46  2631 this.latex = latex;
 47    }
 48   
 49    /**
 50    * Constructs an empty LaTeX text part.
 51    */
 52  3419 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  3406 public final void setLanguage(final String language) {
 62  3406 this.language = language;
 63    }
 64   
 65  14766 public final String getLanguage() {
 66  14766 return language;
 67    }
 68   
 69    /**
 70    * Set LaTeX text.
 71    *
 72    * @param latex LaTeX text.
 73    */
 74  3406 public final void setLatex(final String latex) {
 75  3406 this.latex = latex;
 76    }
 77   
 78  13164 public final String getLatex() {
 79  13164 return latex;
 80    }
 81   
 82  2055 public boolean equals(final Object obj) {
 83  2055 if (!(obj instanceof LatexVo)) {
 84  8 return false;
 85    }
 86  2047 final LatexVo other = (LatexVo) obj;
 87  2047 return EqualsUtility.equals(getLanguage(), other.getLanguage())
 88    && EqualsUtility.equals(getLatex(), other.getLatex());
 89    }
 90   
 91  1929 public int hashCode() {
 92  1929 return (getLanguage() != null ? getLanguage().hashCode() : 0)
 93  1929 ^ (getLatex() != null ? 1 ^ getLatex().hashCode() : 0);
 94    }
 95   
 96  1424 public String toString() {
 97  1424 return "\"" + getLanguage() + "\":" + getLatex();
 98    }
 99   
 100    }