Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
11   82   10   1.57
6   34   0.91   7
7     1.43  
1    
 
  FormulaVo       Line # 29 11 10 100% 1.0
 
  (92)
 
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.list.Element;
20    import org.qedeq.kernel.se.base.module.Formula;
21   
22   
23    /**
24    * Wraps a formula. Such an object is build out of
25    * {@link org.qedeq.kernel.se.base.list.Element}s.
26    *
27    * @author Michael Meyling
28    */
 
29    public class FormulaVo implements Formula {
30   
31    /** Formula. */
32    private Element element;
33   
34    /**
35    * Constructs a formula.
36    *
37    * @param element Element that should be a formula.
38    */
 
39  30412 toggle public FormulaVo(final Element element) {
40  30412 this.element = element;
41    }
42   
43    /**
44    * Empty constructor.
45    */
 
46  23186 toggle public FormulaVo() {
47    // nothing to do
48    }
49   
50    /**
51    * Set formula.
52    *
53    * @param element Formula.
54    */
 
55  23171 toggle public final void setElement(final Element element) {
56  23171 this.element = element;
57    }
58   
 
59  1051443 toggle public final Element getElement() {
60  1051443 return element;
61    }
62   
 
63  554 toggle public boolean equals(final Object obj) {
64  554 if (!(obj instanceof FormulaVo)) {
65  19 return false;
66    }
67  535 final FormulaVo other = (FormulaVo) obj;
68  535 return EqualsUtility.equals(getElement(), other.getElement());
69    }
70   
 
71  824 toggle public int hashCode() {
72  824 return (getElement() != null ? getElement().hashCode() : 0);
73    }
74   
 
75  579 toggle public String toString() {
76  579 if (getElement() != null) {
77  575 return getElement().toString();
78    }
79  4 return "";
80    }
81   
82    }