Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Sa Okt 21 2006 08:24:31 CEST
file stats: LOC: 102   Methods: 9
NCLOC: 41   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ImportBo.java 100% 83,3% 88,9% 88,9%
coverage coverage
 1    /* $Id: ImportBo.java,v 1.4 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.Import;
 21    import org.qedeq.kernel.base.module.Specification;
 22    import org.qedeq.kernel.utility.EqualsUtility;
 23   
 24   
 25    /**
 26    * Module import. Every needed module must be referenced as an module import.
 27    *
 28    * @version $Revision: 1.4 $
 29    * @author Michael Meyling
 30    */
 31    public final class ImportBo implements Import {
 32   
 33    /** Label for the imported module. All references to that module must have this prefix. */
 34    private String label;
 35   
 36    /** Specification of imported module. Includes location information. */
 37    private Specification specification;
 38   
 39    /**
 40    * Constructs a new import.
 41    *
 42    * @param label Label for this import. All references to that module must have
 43    * this prefix.
 44    * @param specification Import specification. Includes location information.
 45    */
 46  0 public ImportBo(final String label, final Specification specification) {
 47  0 this.label = label;
 48  0 this.specification = specification;
 49    }
 50   
 51    /**
 52    * Constructs an empty import.
 53    */
 54  75 public ImportBo() {
 55    // nothing to do
 56    }
 57   
 58    /**
 59    * Set label for this import. All references to that module must have this prefix.
 60    *
 61    * @param label Module reference prefix.
 62    */
 63  62 public final void setLabel(final String label) {
 64  62 this.label = label;
 65    }
 66   
 67  335 public final String getLabel() {
 68  335 return label;
 69    }
 70   
 71    /**
 72    * Set import module specification.
 73    *
 74    * @param specification Import module specifiaction.
 75    */
 76  62 public final void setSpecification(final Specification specification) {
 77  62 this.specification = specification;
 78    }
 79   
 80  335 public final Specification getSpecification() {
 81  335 return specification;
 82    }
 83   
 84  99 public boolean equals(final Object obj) {
 85  99 if (!(obj instanceof ImportBo)) {
 86  5 return false;
 87    }
 88  94 final ImportBo other = (ImportBo) obj;
 89  94 return EqualsUtility.equals(getLabel(), other.getLabel())
 90    && EqualsUtility.equals(getSpecification(), other.getSpecification());
 91    }
 92   
 93  84 public int hashCode() {
 94  84 return (getLabel() != null ? getLabel().hashCode() : 0)
 95  84 ^ (getSpecification() != null ? 1 ^ getSpecification().hashCode() : 0);
 96    }
 97   
 98  65 public String toString() {
 99  65 return label + ":" + specification;
 100    }
 101   
 102    }