Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Sa Okt 21 2006 08:24:31 CEST
file stats: LOC: 111   Methods: 11
NCLOC: 52   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
SpecificationBo.java 100% 80% 90,9% 88,2%
coverage coverage
 1    /* $Id: SpecificationBo.java,v 1.3 2006/10/20 20:23:00 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2006, 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.module;
 19   
 20    import org.qedeq.kernel.base.module.LocationList;
 21    import org.qedeq.kernel.base.module.Specification;
 22    import org.qedeq.kernel.utility.EqualsUtility;
 23   
 24   
 25    /**
 26    * Describes a specification of a module, that means its name, versions and
 27    * possible "physical" locations.
 28    * The combination of {@link #getName()} and {@link #getRuleVersion()} defines
 29    * the file name of that module.
 30    *
 31    * @version $Revision: 1.3 $
 32    * @author Michael Meyling
 33    */
 34    public final class SpecificationBo implements Specification {
 35   
 36    /** Module name. */
 37    private String name;
 38   
 39    /** Rule version, that is needed to verify the module. */
 40    private String ruleVersion;
 41   
 42    /** List of locations for the module. */
 43    private LocationList locationList;
 44   
 45    /**
 46    * Constructs a module specification. The combination of <code>name</code> and
 47    * <code>ruleVersion</code> defines the file name of that module.
 48    *
 49    * @param name Module name.
 50    * @param ruleVersion Rule version. This version is at least needed to verify that module.
 51    * @param locations List of locations for that module.
 52    */
 53  0 public SpecificationBo(final String name, final String ruleVersion,
 54    final LocationList locations) {
 55  0 this.name = name;
 56  0 this.ruleVersion = ruleVersion;
 57  0 this.locationList = locations;
 58    }
 59   
 60    /**
 61    * Constructs an empty module specification.
 62    */
 63  168 public SpecificationBo() {
 64    // nothing to do
 65    }
 66   
 67  137 public final void setName(final String name) {
 68  137 this.name = name;
 69    }
 70   
 71  939 public final String getName() {
 72  939 return name;
 73    }
 74   
 75  137 public final void setRuleVersion(final String ruleVersion) {
 76  137 this.ruleVersion = ruleVersion;
 77    }
 78   
 79  921 public final String getRuleVersion() {
 80  921 return ruleVersion;
 81    }
 82   
 83  150 public final void setLocationList(final LocationList locations) {
 84  150 this.locationList = locations;
 85    }
 86   
 87  895 public final LocationList getLocationList() {
 88  895 return locationList;
 89    }
 90   
 91  266 public boolean equals(final Object obj) {
 92  266 if (!(obj instanceof SpecificationBo)) {
 93  11 return false;
 94    }
 95  255 final SpecificationBo other = (SpecificationBo) obj;
 96  255 return EqualsUtility.equals(getName(), other.getName())
 97    && EqualsUtility.equals(getRuleVersion(), other.getRuleVersion())
 98    && EqualsUtility.equals(getLocationList(), other.getLocationList());
 99    }
 100   
 101  217 public int hashCode() {
 102  217 return (getName() != null ? getName().hashCode() : 0)
 103  217 ^ (getRuleVersion() != null ? 1 ^ getRuleVersion().hashCode() : 0)
 104  217 ^ (getLocationList() != null ? 1 ^ getLocationList().hashCode() : 0);
 105    }
 106   
 107  151 public String toString() {
 108  151 return "Name: " + name + ", Rule Version: " + ruleVersion + "\n" + locationList;
 109    }
 110   
 111    }