Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
12   97   12   1.33
6   40   1   9
9     1.33  
1    
 
  LatexVo       Line # 27 12 12 100% 1.0
 
  (137)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, 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.se.dto.module;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19    import org.qedeq.kernel.se.base.module.Latex;
20   
21   
22    /**
23    * LaTeX text part.
24    *
25    * @author Michael Meyling
26    */
 
27    public class LatexVo implements Latex {
28   
29    /** Text language. */
30    private String language;
31   
32    /** LaTeX text. */
33    private String latex;
34   
35    /**
36    * Constructs a LaTeX text part.
37    *
38    * @param language Language of this part.
39    * @param latex LaTeX text.
40    */
 
41  118434 toggle public LatexVo(final String language, final String latex) {
42  118434 this.language = language;
43  118434 this.latex = latex;
44    }
45   
46    /**
47    * Constructs an empty LaTeX text part.
48    */
 
49  118645 toggle public LatexVo() {
50    // nothing to do
51    }
52   
53    /**
54    * Set text language. Examples are <code>en</code>, <code>de</code>.
55    *
56    * @param language Language.
57    */
 
58  118605 toggle public final void setLanguage(final String language) {
59  118605 this.language = language;
60    }
61   
 
62  733734 toggle public final String getLanguage() {
63  733734 return language;
64    }
65   
66    /**
67    * Set LaTeX text.
68    *
69    * @param latex LaTeX text.
70    */
 
71  118605 toggle public final void setLatex(final String latex) {
72  118605 this.latex = latex;
73    }
74   
 
75  712595 toggle public final String getLatex() {
76  712595 return latex;
77    }
78   
 
79  2082 toggle public boolean equals(final Object obj) {
80  2082 if (!(obj instanceof LatexVo)) {
81  8 return false;
82    }
83  2074 final LatexVo other = (LatexVo) obj;
84  2074 return EqualsUtility.equals(getLanguage(), other.getLanguage())
85    && EqualsUtility.equals(getLatex(), other.getLatex());
86    }
87   
 
88  2913 toggle public int hashCode() {
89  2913 return (getLanguage() != null ? getLanguage().hashCode() : 0)
90  2913 ^ (getLatex() != null ? 1 ^ getLatex().hashCode() : 0);
91    }
92   
 
93  2289 toggle public String toString() {
94  2289 return "\"" + getLanguage() + "\":" + getLatex();
95    }
96   
97    }