Clover Coverage Report
Coverage timestamp: Sat Sep 18 2010 04:09:52 UTC
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
12   98   10   1.33
6   40   0.83   9
9     1.11  
1    
 
  LatexVo       Line # 28 12 10 100% 1.0
 
  (75)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2010, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.kernel.dto.module;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19    import org.qedeq.kernel.base.module.Latex;
20   
21   
22    /**
23    * LaTeX text part.
24    *
25    * @version $Revision: 1.10 $
26    * @author Michael Meyling
27    */
 
28    public class LatexVo implements Latex {
29   
30    /** Text language. */
31    private String language;
32   
33    /** LaTeX text. */
34    private String latex;
35   
36    /**
37    * Constructs a LaTeX text part.
38    *
39    * @param language Language of this part.
40    * @param latex LaTeX text.
41    */
 
42  10267 toggle public LatexVo(final String language, final String latex) {
43  10267 this.language = language;
44  10267 this.latex = latex;
45    }
46   
47    /**
48    * Constructs an empty LaTeX text part.
49    */
 
50  10319 toggle public LatexVo() {
51    // nothing to do
52    }
53   
54    /**
55    * Set text language. Examples are <code>en</code>, <code>de</code>.
56    *
57    * @param language Language.
58    */
 
59  10306 toggle public final void setLanguage(final String language) {
60  10306 this.language = language;
61    }
62   
 
63  43700 toggle public final String getLanguage() {
64  43700 return language;
65    }
66   
67    /**
68    * Set LaTeX text.
69    *
70    * @param latex LaTeX text.
71    */
 
72  10306 toggle public final void setLatex(final String latex) {
73  10306 this.latex = latex;
74    }
75   
 
76  25407 toggle public final String getLatex() {
77  25407 return latex;
78    }
79   
 
80  1771 toggle public boolean equals(final Object obj) {
81  1771 if (!(obj instanceof LatexVo)) {
82  8 return false;
83    }
84  1763 final LatexVo other = (LatexVo) obj;
85  1763 return EqualsUtility.equals(getLanguage(), other.getLanguage())
86    && EqualsUtility.equals(getLatex(), other.getLatex());
87    }
88   
 
89  2499 toggle public int hashCode() {
90  2499 return (getLanguage() != null ? getLanguage().hashCode() : 0)
91  2499 ^ (getLatex() != null ? 1 ^ getLatex().hashCode() : 0);
92    }
93   
 
94  1946 toggle public String toString() {
95  1946 return "\"" + getLanguage() + "\":" + getLatex();
96    }
97   
98    }