Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
13   90   11   1.62
6   40   0.85   8
8     1.38  
1    
 
  LiteratureItemVo       Line # 28 13 11 100% 1.0
 
  (26)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, 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.se.dto.module;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19    import org.qedeq.kernel.se.base.module.LatexList;
20    import org.qedeq.kernel.se.base.module.LiteratureItem;
21   
22   
23    /**
24    * Single literature reference.
25    *
26    * @author Michael Meyling
27    */
 
28    public class LiteratureItemVo implements LiteratureItem {
29   
30    /** Reference to this object with this label. */
31    private String label;
32   
33    /** Reference description. */
34    private LatexList item;
35   
36    /**
37    * Constructs a new section.
38    */
 
39  2170 toggle public LiteratureItemVo() {
40    // nothing to do
41    }
42   
43    /**
44    * Set reference label for this literature reference.
45    *
46    * @param label Reference to this object with this label.
47    */
 
48  2154 toggle public final void setLabel(final String label) {
49  2154 this.label = label;
50    }
51   
 
52  2531 toggle public final String getLabel() {
53  2531 return label;
54    }
55   
56    /**
57    * Set literature reference for this item.
58    *
59    * @param item literature reference.
60    */
 
61  2156 toggle public final void setItem(final LatexListVo item) {
62  2156 this.item = item;
63    }
64   
 
65  9362 toggle public final LatexList getItem() {
66  9362 return item;
67    }
68   
 
69  57 toggle public boolean equals(final Object obj) {
70  57 if (!(obj instanceof LiteratureItemVo)) {
71  5 return false;
72    }
73  52 final LiteratureItemVo other = (LiteratureItemVo) obj;
74  52 return EqualsUtility.equals(getLabel(), other.getLabel())
75    && EqualsUtility.equals(getItem(), other.getItem());
76    }
77   
 
78  77 toggle public int hashCode() {
79  77 return (getLabel() != null ? getLabel().hashCode() : 0)
80  77 ^ (getItem() != null ? 3 ^ getItem().hashCode() : 0);
81    }
82   
 
83  64 toggle public String toString() {
84  64 final StringBuffer buffer = new StringBuffer();
85  64 buffer.append("Item label: " + label + "\n");
86  64 buffer.append(getItem() + "\n");
87  64 return buffer.toString();
88    }
89   
90    }