Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
12   105   14   1.2
8   46   1.17   10
10     1.4  
1    
 
  ProofVo       Line # 28 12 14 100% 1.0
 
  (38)
 
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.Proof;
21   
22   
23    /**
24    * Contains a non formal proof for a proposition or rule.
25    *
26    * @author Michael Meyling
27    */
 
28    public class ProofVo implements Proof {
29   
30    /** Kind of proof. */
31    private String kind;
32   
33    /** Proof detail level. */
34    private String level;
35   
36    /** LaTeX text for non formal proof. */
37    private LatexList nonFormalProof;
38   
39    /**
40    * Constructs an empty proof.
41    */
 
42  5964 toggle public ProofVo() {
43    // nothing to do
44    }
45   
 
46  4361 toggle public String getKind() {
47  4361 return kind;
48    }
49   
50    /**
51    * Set kind of proof. E.g. "informal".
52    *
53    * @param kind Set proof type.
54    */
 
55  5940 toggle public final void setKind(final String kind) {
56  5940 this.kind = kind;
57    }
58   
 
59  4327 toggle public String getLevel() {
60  4327 return level;
61    }
62   
63    /**
64    * Set proof level. Higher proof levels contain more detailed proofs.
65    *
66    * @param level Proof level.
67    */
 
68  5940 toggle public final void setLevel(final String level) {
69  5940 this.level = level;
70    }
71   
72    /**
73    * Set LaTeX text for non formal proof.
74    *
75    * @param nonFormalProof The proof text.
76    */
 
77  5944 toggle public final void setNonFormalProof(final LatexList nonFormalProof) {
78  5944 this.nonFormalProof = nonFormalProof;
79    }
80   
 
81  9584 toggle public final LatexList getNonFormalProof() {
82  9584 return nonFormalProof;
83    }
84   
 
85  260 toggle public boolean equals(final Object obj) {
86  260 if (!(obj instanceof ProofVo)) {
87  8 return false;
88    }
89  252 final ProofVo other = (ProofVo) obj;
90  252 return EqualsUtility.equals(getKind(), other.getKind())
91    && EqualsUtility.equals(getLevel(), other.getLevel())
92    && EqualsUtility.equals(getNonFormalProof(), other.getNonFormalProof());
93    }
94   
 
95  281 toggle public int hashCode() {
96  281 return (getKind() != null ? getKind().hashCode() : 0)
97  281 ^ (getLevel() != null ? 1 ^ getLevel().hashCode() : 0)
98  281 ^ (getNonFormalProof() != null ? 2 ^ getNonFormalProof().hashCode() : 0);
99    }
100   
 
101  222 toggle public String toString() {
102  222 return "Proof (" + getKind() + ", " + getLevel() + "): " + getNonFormalProof();
103    }
104   
105    }