Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Dez 29 2005 18:38:29 CET
file stats: LOC: 85   Methods: 7
NCLOC: 34   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
FormulaOrTermVo.java 100% 100% 100% 100%
coverage
 1    /* $Id: FormulaOrTermVo.java,v 1.4 2005/06/15 16:11:47 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2005, 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.kernel.base.elli.Element;
 21    import org.qedeq.kernel.base.module.FormulaOrTerm;
 22    import org.qedeq.kernel.utility.EqualsUtility;
 23   
 24   
 25    /**
 26    * Wraps a formula or a term. Such an object is build out of
 27    * {@link org.qedeq.kernel.base.elli.Element}s.
 28    *
 29    * @version $Revision: 1.4 $
 30    * @author Michael Meyling
 31    */
 32    public final class FormulaOrTermVo implements FormulaOrTerm {
 33   
 34    /** Formula or term. */
 35    private Element element;
 36   
 37    /**
 38    * Constructs a formula or term.
 39    *
 40    * @param element Element that should be a formula or term.
 41    */
 42  49 public FormulaOrTermVo(final Element element) {
 43  49 this.element = element;
 44    }
 45   
 46    /**
 47    * Empty constructor.
 48    */
 49  163 public FormulaOrTermVo() {
 50    // nothing to do
 51    }
 52   
 53    /**
 54    * Set formula or term.
 55    *
 56    * @param element Formula or term.
 57    */
 58  155 public final void setElement(final Element element) {
 59  155 this.element = element;
 60    }
 61   
 62  1074 public final Element getElement() {
 63  1074 return element;
 64    }
 65   
 66  202 public boolean equals(final Object obj) {
 67  202 if (!(obj instanceof FormulaOrTermVo)) {
 68  11 return false;
 69    }
 70  191 final FormulaOrTermVo other = (FormulaOrTermVo) obj;
 71  191 return EqualsUtility.equals(getElement(), other.getElement());
 72    }
 73   
 74  189 public int hashCode() {
 75  189 return (getElement() != null ? getElement().hashCode() : 0);
 76    }
 77   
 78  136 public String toString() {
 79  136 if (getElement() != null) {
 80  124 return getElement().toString();
 81    }
 82  12 return "";
 83    }
 84   
 85    }