Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
12   100   10   1,33
6   40   0,83   9
9     1,11  
1    
 
  LatexVo       Line # 30 12 10 100% 1.0
 
  (61)
 
1    /* $Id: LatexVo.java,v 1.10 2008/07/26 07:59:35 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, 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.base.utility.EqualsUtility;
21    import org.qedeq.kernel.base.module.Latex;
22   
23   
24    /**
25    * LaTeX text part.
26    *
27    * @version $Revision: 1.10 $
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  9003 toggle public LatexVo(final String language, final String latex) {
45  9003 this.language = language;
46  9003 this.latex = latex;
47    }
48   
49    /**
50    * Constructs an empty LaTeX text part.
51    */
 
52  9082 toggle 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  9069 toggle public final void setLanguage(final String language) {
62  9069 this.language = language;
63    }
64   
 
65  38352 toggle public final String getLanguage() {
66  38352 return language;
67    }
68   
69    /**
70    * Set LaTeX text.
71    *
72    * @param latex LaTeX text.
73    */
 
74  9069 toggle public final void setLatex(final String latex) {
75  9069 this.latex = latex;
76    }
77   
 
78  21408 toggle public final String getLatex() {
79  21408 return latex;
80    }
81   
 
82  1728 toggle public boolean equals(final Object obj) {
83  1728 if (!(obj instanceof LatexVo)) {
84  8 return false;
85    }
86  1720 final LatexVo other = (LatexVo) obj;
87  1720 return EqualsUtility.equals(getLanguage(), other.getLanguage())
88    && EqualsUtility.equals(getLatex(), other.getLatex());
89    }
90   
 
91  1705 toggle public int hashCode() {
92  1705 return (getLanguage() != null ? getLanguage().hashCode() : 0)
93  1705 ^ (getLatex() != null ? 1 ^ getLatex().hashCode() : 0);
94    }
95   
 
96  1158 toggle public String toString() {
97  1158 return "\"" + getLanguage() + "\":" + getLatex();
98    }
99   
100    }