Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Jan 11 2007 09:03:50 CET
file stats: LOC: 116   Methods: 11
NCLOC: 52   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
SpecificationVo.java 100% 100% 100% 100%
coverage
 1    /* $Id: SpecificationVo.java,v 1.3 2006/10/20 20:23:01 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.dto.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 possible
 27    * "physical" locations.
 28    * The combination of {@link #getName()} and {@link #getRuleVersion()} defines the
 29    * file name of that module.
 30    *
 31    * @version $Revision: 1.3 $
 32    * @author Michael Meyling
 33    */
 34    public final class SpecificationVo 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  74 public SpecificationVo(final String name, final String ruleVersion,
 54    final LocationList locations) {
 55  74 this.name = name;
 56  74 this.ruleVersion = ruleVersion;
 57  74 this.locationList = locations;
 58    }
 59   
 60    /**
 61    * Constructs an empty module specification.
 62    */
 63  212 public SpecificationVo() {
 64    // nothing to do
 65    }
 66   
 67  194 public final void setName(final String name) {
 68  194 this.name = name;
 69    }
 70   
 71  1423 public final String getName() {
 72  1423 return name;
 73    }
 74   
 75  194 public final void setRuleVersion(final String ruleVersion) {
 76  194 this.ruleVersion = ruleVersion;
 77    }
 78   
 79  1405 public final String getRuleVersion() {
 80  1405 return ruleVersion;
 81    }
 82   
 83    /**
 84    * Set list of locations for the module.
 85    *
 86    * @param locations List of locations for that module.
 87    */
 88  194 public final void setLocationList(final LocationListVo locations) {
 89  194 this.locationList = locations;
 90    }
 91   
 92  1459 public final LocationList getLocationList() {
 93  1459 return locationList;
 94    }
 95   
 96  371 public boolean equals(final Object obj) {
 97  371 if (!(obj instanceof SpecificationVo)) {
 98  11 return false;
 99    }
 100  360 final SpecificationVo other = (SpecificationVo) obj;
 101  360 return EqualsUtility.equals(getName(), other.getName())
 102    && EqualsUtility.equals(getRuleVersion(), other.getRuleVersion())
 103    && EqualsUtility.equals(getLocationList(), other.getLocationList());
 104    }
 105   
 106  313 public int hashCode() {
 107  313 return (getName() != null ? getName().hashCode() : 0)
 108  313 ^ (getRuleVersion() != null ? 1 ^ getRuleVersion().hashCode() : 0)
 109  313 ^ (getLocationList() != null ? 1 ^ getLocationList().hashCode() : 0);
 110    }
 111   
 112  199 public String toString() {
 113  199 return "Name: " + name + ", Rule Version: " + ruleVersion + "\n" + locationList;
 114    }
 115   
 116    }