Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Sa Jan 26 2008 14:11:34 CET
file stats: LOC: 109   Methods: 9
NCLOC: 47   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
DefaultQedeqBo.java 100% 100% 100% 100%
coverage
 1    /* $Id: DefaultQedeqBo.java,v 1.2 2007/12/21 23:33:46 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2007, 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.bo.load;
 19   
 20    import org.qedeq.kernel.base.module.Qedeq;
 21    import org.qedeq.kernel.bo.module.ModuleAddress;
 22    import org.qedeq.kernel.bo.module.ModuleLabels;
 23    import org.qedeq.kernel.bo.module.QedeqBo;
 24    import org.qedeq.kernel.utility.EqualsUtility;
 25   
 26   
 27    /**
 28    * A complete QEDEQ module. This is the root business object.
 29    *
 30    * TODO mime 20070131: shouldn't be a globalContext also an attribute of this class?
 31    *
 32    * @version $Revision: 1.2 $
 33    * @author Michael Meyling
 34    */
 35    public class DefaultQedeqBo implements QedeqBo {
 36   
 37    /** QEDEQ data transfer object. */
 38    private Qedeq qedeq;
 39   
 40    /** All module labels and their business objects. */
 41    private final ModuleLabels moduleLabels;
 42   
 43    /** Module address information. */
 44    private ModuleAddress moduleAddress;
 45   
 46    /**
 47    * Constructs a new empty QEDEQ module.
 48    */
 49  334 public DefaultQedeqBo() {
 50  334 moduleLabels = new ModuleLabels();
 51    }
 52   
 53  318 public void setQedeq(final Qedeq qedeq) {
 54  318 this.qedeq = qedeq;
 55    }
 56   
 57  728 public Qedeq getQedeq() {
 58  728 return qedeq;
 59    }
 60   
 61    /**
 62    * Get module label associations for this module.
 63    *
 64    * @return Label associations.
 65    */
 66  2200 public final ModuleLabels getModuleLabels() {
 67  2200 return moduleLabels;
 68    }
 69   
 70    /**
 71    * Get physical addresses of this module.
 72    *
 73    * @return Module address..
 74    */
 75  154 public final ModuleAddress getModuleAddress() {
 76  154 return moduleAddress;
 77    }
 78   
 79    /**
 80    * Get physical addresses of this module.
 81    *
 82    * @param address Module address.
 83    */
 84  314 public final void setModuleAddress(final ModuleAddress address) {
 85  314 this.moduleAddress = address;
 86    }
 87   
 88  33 public boolean equals(final Object obj) {
 89  33 if (!(obj instanceof DefaultQedeqBo)) {
 90  4 return false;
 91    }
 92  29 final DefaultQedeqBo other = (DefaultQedeqBo) obj;
 93  29 return EqualsUtility.equals(getQedeq(), other.getQedeq())
 94    && EqualsUtility.equals(getModuleAddress(), other.getModuleAddress());
 95    }
 96   
 97  20 public int hashCode() {
 98  20 return (getQedeq() != null ? getQedeq().hashCode() : 0)
 99  20 ^ (getModuleAddress() != null ? 1 ^ getModuleAddress().hashCode() : 0);
 100    }
 101   
 102  23 public String toString() {
 103  23 final StringBuffer buffer = new StringBuffer();
 104  23 buffer.append(getModuleAddress() + "\n");
 105  23 buffer.append(getQedeq() + "\n\n");
 106  23 return buffer.toString();
 107    }
 108   
 109    }