Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Mai 10 2007 03:16:40 CEST
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.6 2007/05/10 00:37:50 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.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.6 $
 32    * @author Michael Meyling
 33    */
 34    public 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  114 public SpecificationVo(final String name, final String ruleVersion,
 54    final LocationList locations) {
 55  114 this.name = name;
 56  114 this.ruleVersion = ruleVersion;
 57  114 this.locationList = locations;
 58    }
 59   
 60    /**
 61    * Constructs an empty module specification.
 62    */
 63  242 public SpecificationVo() {
 64    // nothing to do
 65    }
 66   
 67  224 public final void setName(final String name) {
 68  224 this.name = name;
 69    }
 70   
 71  1589 public final String getName() {
 72  1589 return name;
 73    }
 74   
 75  224 public final void setRuleVersion(final String ruleVersion) {
 76  224 this.ruleVersion = ruleVersion;
 77    }
 78   
 79  1526 public final String getRuleVersion() {
 80  1526 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  224 public final void setLocationList(final LocationListVo locations) {
 89  224 this.locationList = locations;
 90    }
 91   
 92  2823 public final LocationList getLocationList() {
 93  2823 return locationList;
 94    }
 95   
 96  392 public boolean equals(final Object obj) {
 97  392 if (!(obj instanceof SpecificationVo)) {
 98  11 return false;
 99    }
 100  381 final SpecificationVo other = (SpecificationVo) obj;
 101  381 return EqualsUtility.equals(getName(), other.getName())
 102    && EqualsUtility.equals(getRuleVersion(), other.getRuleVersion())
 103    && EqualsUtility.equals(getLocationList(), other.getLocationList());
 104    }
 105   
 106  319 public int hashCode() {
 107  319 return (getName() != null ? getName().hashCode() : 0)
 108  319 ^ (getRuleVersion() != null ? 1 ^ getRuleVersion().hashCode() : 0)
 109  319 ^ (getLocationList() != null ? 1 ^ getLocationList().hashCode() : 0);
 110    }
 111   
 112  205 public String toString() {
 113  205 return "Name: " + name + ", Rule Version: " + ruleVersion + "\n" + locationList;
 114    }
 115   
 116    }