Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
13   93   9   1,62
6   40   0,69   8
8     1,12  
1    
 
  LiteratureItemVo       Line # 31 13 9 100% 1.0
 
  (11)
 
1    /* $Id: LiteratureItemVo.java,v 1.6 2008/07/26 07:59:35 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, 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.base.utility.EqualsUtility;
21    import org.qedeq.kernel.base.module.LatexList;
22    import org.qedeq.kernel.base.module.LiteratureItem;
23   
24   
25    /**
26    * Single literature reference.
27    *
28    * @version $Revision: 1.6 $
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  225 toggle 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  212 toggle public final void setLabel(final String label) {
52  212 this.label = label;
53    }
54   
 
55  443 toggle public final String getLabel() {
56  443 return label;
57    }
58   
59    /**
60    * Set literature reference for this item.
61    *
62    * @param item literature reference.
63    */
 
64  212 toggle public final void setItem(final LatexListVo item) {
65  212 this.item = item;
66    }
67   
 
68  2207 toggle public final LatexList getItem() {
69  2207 return item;
70    }
71   
 
72  57 toggle public boolean equals(final Object obj) {
73  57 if (!(obj instanceof LiteratureItemVo)) {
74  5 return false;
75    }
76  52 final LiteratureItemVo other = (LiteratureItemVo) obj;
77  52 return EqualsUtility.equals(getLabel(), other.getLabel())
78    && EqualsUtility.equals(getItem(), other.getItem());
79    }
80   
 
81  59 toggle public int hashCode() {
82  59 return (getLabel() != null ? getLabel().hashCode() : 0)
83  59 ^ (getItem() != null ? 3 ^ getItem().hashCode() : 0);
84    }
85   
 
86  46 toggle public String toString() {
87  46 final StringBuffer buffer = new StringBuffer();
88  46 buffer.append("Item label: " + label + "\n");
89  46 buffer.append(getItem() + "\n");
90  46 return buffer.toString();
91    }
92   
93    }