Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
20   100   14   2
8   50   0.7   10
10     1.4  
1    
 
  AddVo       Line # 28 20 14 100% 1.0
 
  (29)
 
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.apache.commons.lang.ArrayUtils;
19    import org.qedeq.base.utility.EqualsUtility;
20    import org.qedeq.kernel.se.base.module.Add;
21   
22   
23    /**
24    * Usage of formula addition.
25    *
26    * @author Michael Meyling
27    */
 
28    public class AddVo implements Add {
29   
30    /** Reference to previously proven formula. */
31    private String reference;
32   
33    /**
34    * Constructs an addition argument.
35    *
36    * @param reference Reference to a valid formula.
37    */
 
38  2535 toggle public AddVo(final String reference) {
39  2535 this.reference = reference;
40    }
41   
42    /**
43    * Default constructor.
44    */
 
45  35 toggle public AddVo() {
46    // nothing to do
47    }
48   
 
49  3433 toggle public Add getAdd() {
50  3433 return this;
51    }
52   
 
53  3534 toggle public String getReference() {
54  3534 return reference;
55    }
56   
57    /**
58    * Set formula reference.
59    *
60    * @param reference Reference to formula. Might be <code>null</code>.
61    */
 
62  16 toggle public void setReference(final String reference) {
63  16 this.reference = reference;
64    }
65   
 
66  2 toggle public String[] getReferences() {
67  2 if (reference == null) {
68  1 return ArrayUtils.EMPTY_STRING_ARRAY;
69    }
70  1 return new String[] {reference };
71    }
72   
 
73  23 toggle public boolean equals(final Object obj) {
74  23 if (!(obj instanceof AddVo)) {
75  3 return false;
76    }
77  20 final AddVo other = (AddVo) obj;
78  20 return EqualsUtility.equals(reference, other.reference);
79    }
80   
 
81  28 toggle public int hashCode() {
82  28 return (reference != null ? reference.hashCode() : 0);
83    }
84   
 
85  753 toggle public String toString() {
86  753 StringBuffer result = new StringBuffer();
87  753 result.append("Add");
88  753 if (reference != null) {
89  739 result.append(" (");
90  739 result.append(reference);
91  739 result.append(")");
92    }
93  753 return result.toString();
94    }
95   
 
96  823 toggle public String getName() {
97  823 return "Add";
98    }
99   
100    }