Clover Coverage Report
Coverage timestamp: Sat Sep 18 2010 04:09:52 UTC
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
13   91   9   1.62
6   40   0.69   8
8     1.12  
1    
 
  LiteratureItemVo       Line # 29 13 9 100% 1.0
 
  (11)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2010, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.kernel.dto.module;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19    import org.qedeq.kernel.base.module.LatexList;
20    import org.qedeq.kernel.base.module.LiteratureItem;
21   
22   
23    /**
24    * Single literature reference.
25    *
26    * @version $Revision: 1.6 $
27    * @author Michael Meyling
28    */
 
29    public class LiteratureItemVo implements LiteratureItem {
30   
31    /** Reference to this object with this label. */
32    private String label;
33   
34    /** Reference description. */
35    private LatexList item;
36   
37    /**
38    * Constructs a new section.
39    */
 
40  225 toggle public LiteratureItemVo() {
41    // nothing to do
42    }
43   
44    /**
45    * Set reference label for this literature reference.
46    *
47    * @param label Reference to this object with this label.
48    */
 
49  212 toggle public final void setLabel(final String label) {
50  212 this.label = label;
51    }
52   
 
53  479 toggle public final String getLabel() {
54  479 return label;
55    }
56   
57    /**
58    * Set literature reference for this item.
59    *
60    * @param item literature reference.
61    */
 
62  212 toggle public final void setItem(final LatexListVo item) {
63  212 this.item = item;
64    }
65   
 
66  2261 toggle public final LatexList getItem() {
67  2261 return item;
68    }
69   
 
70  57 toggle public boolean equals(final Object obj) {
71  57 if (!(obj instanceof LiteratureItemVo)) {
72  5 return false;
73    }
74  52 final LiteratureItemVo other = (LiteratureItemVo) obj;
75  52 return EqualsUtility.equals(getLabel(), other.getLabel())
76    && EqualsUtility.equals(getItem(), other.getItem());
77    }
78   
 
79  77 toggle public int hashCode() {
80  77 return (getLabel() != null ? getLabel().hashCode() : 0)
81  77 ^ (getItem() != null ? 3 ^ getItem().hashCode() : 0);
82    }
83   
 
84  64 toggle public String toString() {
85  64 final StringBuffer buffer = new StringBuffer();
86  64 buffer.append("Item label: " + label + "\n");
87  64 buffer.append(getItem() + "\n");
88  64 return buffer.toString();
89    }
90   
91    }