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