Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Jan 11 2007 09:03:50 CET
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.1 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.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.1 $
 29    * @author Michael Meyling
 30    */
 31    public final 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  116 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  103 public final void setLabel(final String label) {
 52  103 this.label = label;
 53    }
 54   
 55  378 public final String getLabel() {
 56  378 return label;
 57    }
 58   
 59    /**
 60    * Set literature reference for this item.
 61    *
 62    * @param item literature reference.
 63    */
 64  103 public final void setItem(final LatexListVo item) {
 65  103 this.item = item;
 66    }
 67   
 68  482 public final LatexList getItem() {
 69  482 return item;
 70    }
 71   
 72  79 public boolean equals(final Object obj) {
 73  79 if (!(obj instanceof LiteratureItemVo)) {
 74  5 return false;
 75    }
 76  74 final LiteratureItemVo other = (LiteratureItemVo) obj;
 77  74 return EqualsUtility.equals(getLabel(), other.getLabel())
 78    && EqualsUtility.equals(getItem(), other.getItem());
 79    }
 80   
 81  80 public int hashCode() {
 82  80 return (getLabel() != null ? getLabel().hashCode() : 0)
 83  80 ^ (getItem() != null ? 3 ^ getItem().hashCode() : 0);
 84    }
 85   
 86  61 public String toString() {
 87  61 final StringBuffer buffer = new StringBuffer();
 88  61 buffer.append("Item label: " + label + "\n");
 89  61 buffer.append(getItem() + "\n");
 90  61 return buffer.toString();
 91    }
 92   
 93    }