Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Mai 10 2007 03:16:40 CEST
file stats: LOC: 93   Methods: 8
NCLOC: 40   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
LiteratureItemVo.java 100% 100% 100% 100%
coverage
 1    /* $Id: LiteratureItemVo.java,v 1.4 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.LatexList;
 21    import org.qedeq.kernel.base.module.LiteratureItem;
 22    import org.qedeq.kernel.utility.EqualsUtility;
 23   
 24   
 25    /**
 26    * Single literature reference.
 27    *
 28    * @version $Revision: 1.4 $
 29    * @author Michael Meyling
 30    */
 31    public class LiteratureItemVo implements LiteratureItem {
 32   
 33    /** Reference to this object with this label. */
 34    private String label;
 35   
 36    /** Reference description. */
 37    private LatexList item;
 38   
 39    /**
 40    * Constructs a new section.
 41    */
 42  143 public LiteratureItemVo() {
 43    // nothing to do
 44    }
 45   
 46    /**
 47    * Set reference label for this literature reference.
 48    *
 49    * @param label Reference to this object with this label.
 50    */
 51  130 public final void setLabel(final String label) {
 52  130 this.label = label;
 53    }
 54   
 55  440 public final String getLabel() {
 56  440 return label;
 57    }
 58   
 59    /**
 60    * Set literature reference for this item.
 61    *
 62    * @param item literature reference.
 63    */
 64  130 public final void setItem(final LatexListVo item) {
 65  130 this.item = item;
 66    }
 67   
 68  1687 public final LatexList getItem() {
 69  1687 return item;
 70    }
 71   
 72  86 public boolean equals(final Object obj) {
 73  86 if (!(obj instanceof LiteratureItemVo)) {
 74  5 return false;
 75    }
 76  81 final LiteratureItemVo other = (LiteratureItemVo) obj;
 77  81 return EqualsUtility.equals(getLabel(), other.getLabel())
 78    && EqualsUtility.equals(getItem(), other.getItem());
 79    }
 80   
 81  82 public int hashCode() {
 82  82 return (getLabel() != null ? getLabel().hashCode() : 0)
 83  82 ^ (getItem() != null ? 3 ^ getItem().hashCode() : 0);
 84    }
 85   
 86  63 public String toString() {
 87  63 final StringBuffer buffer = new StringBuffer();
 88  63 buffer.append("Item label: " + label + "\n");
 89  63 buffer.append(getItem() + "\n");
 90  63 return buffer.toString();
 91    }
 92   
 93    }