Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
11   85   9   1,57
6   34   0,82   7
7     1,29  
1    
 
  TermVo       Line # 32 11 9 100% 1.0
 
  (8)
 
1    /* $Id: TermVo.java,v 1.5 2008/07/26 07:59:35 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, Michael Meyling <mime@qedeq.org>.
6    *
7    * "Hilbert II" is free software; you can redistribute
8    * it and/or modify it under the terms of the GNU General Public
9    * License as published by the Free Software Foundation; either
10    * version 2 of the License, or (at your option) any later version.
11    *
12    * This program is distributed in the hope that it will be useful,
13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    * GNU General Public License for more details.
16    */
17   
18    package org.qedeq.kernel.dto.module;
19   
20    import org.qedeq.base.utility.EqualsUtility;
21    import org.qedeq.kernel.base.list.Element;
22    import org.qedeq.kernel.base.module.Term;
23   
24   
25    /**
26    * Wraps a fterm. Such an object is build out of
27    * {@link org.qedeq.kernel.base.list.Element}s.
28    *
29    * @version $Revision: 1.5 $
30    * @author Michael Meyling
31    */
 
32    public class TermVo implements Term {
33   
34    /** Formula or term. */
35    private Element element;
36   
37    /**
38    * Constructs a term.
39    *
40    * @param element Element that should be a term.
41    */
 
42  128 toggle public TermVo(final Element element) {
43  128 this.element = element;
44    }
45   
46    /**
47    * Empty constructor.
48    */
 
49  150 toggle public TermVo() {
50    // nothing to do
51    }
52   
53    /**
54    * Set term.
55    *
56    * @param element Term.
57    */
 
58  142 toggle public final void setElement(final Element element) {
59  142 this.element = element;
60    }
61   
 
62  5445 toggle public final Element getElement() {
63  5445 return element;
64    }
65   
 
66  35 toggle public boolean equals(final Object obj) {
67  35 if (!(obj instanceof TermVo)) {
68  5 return false;
69    }
70  30 final TermVo other = (TermVo) obj;
71  30 return EqualsUtility.equals(getElement(), other.getElement());
72    }
73   
 
74  32 toggle public int hashCode() {
75  32 return (getElement() != null ? getElement().hashCode() : 0);
76    }
77   
 
78  24 toggle public String toString() {
79  24 if (getElement() != null) {
80  12 return getElement().toString();
81    }
82  12 return "";
83    }
84   
85    }