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    
 
  TermVo       Line # 30 11 9 100% 1.0
 
  (12)
 
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.Term;
21   
22   
23    /**
24    * Wraps a fterm. 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 TermVo implements Term {
31   
32    /** Formula or term. */
33    private Element element;
34   
35    /**
36    * Constructs a term.
37    *
38    * @param element Element that should be a term.
39    */
 
40  134 toggle public TermVo(final Element element) {
41  134 this.element = element;
42    }
43   
44    /**
45    * Empty constructor.
46    */
 
47  156 toggle public TermVo() {
48    // nothing to do
49    }
50   
51    /**
52    * Set term.
53    *
54    * @param element Term.
55    */
 
56  148 toggle public final void setElement(final Element element) {
57  148 this.element = element;
58    }
59   
 
60  5606 toggle public final Element getElement() {
61  5606 return element;
62    }
63   
 
64  47 toggle public boolean equals(final Object obj) {
65  47 if (!(obj instanceof TermVo)) {
66  5 return false;
67    }
68  42 final TermVo other = (TermVo) obj;
69  42 return EqualsUtility.equals(getElement(), other.getElement());
70    }
71   
 
72  60 toggle public int hashCode() {
73  60 return (getElement() != null ? getElement().hashCode() : 0);
74    }
75   
 
76  43 toggle public String toString() {
77  43 if (getElement() != null) {
78  39 return getElement().toString();
79    }
80  4 return "";
81    }
82   
83    }