Clover coverage report - QedeqKernelSe Coverage Report
Coverage timestamp: Do Jan 11 2007 09:03:50 CET
file stats: LOC: 110   Methods: 10
NCLOC: 46   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ProofVo.java 100% 100% 100% 100%
coverage
 1    /* $Id: ProofVo.java,v 1.4 2006/10/20 20:23:01 m31 Exp $
 2    *
 3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
 4    *
 5    * Copyright 2000-2006, 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.kernel.base.module.LatexList;
 21    import org.qedeq.kernel.base.module.Proof;
 22    import org.qedeq.kernel.utility.EqualsUtility;
 23   
 24   
 25    /**
 26    * Contains a proof for a proposition.
 27    *
 28    * TODO mime 20050220: add formal proof
 29    *
 30    * @version $Revision: 1.4 $
 31    * @author Michael Meyling
 32    */
 33    public final class ProofVo implements Proof {
 34   
 35    /** Kind of proof. */
 36    private String kind;
 37   
 38    /** Proof detail level. */
 39    private String level;
 40   
 41    /** LaTeX text for non formal proof. */
 42    private LatexList nonFormalProof;
 43   
 44    /**
 45    * Constructs an empty proof.
 46    */
 47  122 public ProofVo() {
 48    // nothing to do
 49    }
 50   
 51  561 public String getKind() {
 52  561 return kind;
 53    }
 54   
 55    /**
 56    * Set kind of proof. E.g. "informal".
 57    *
 58    * @param kind Set proof type.
 59    */
 60  89 public final void setKind(final String kind) {
 61  89 this.kind = kind;
 62    }
 63   
 64  563 public String getLevel() {
 65  563 return level;
 66    }
 67   
 68    /**
 69    * Set proof level. Higher proof levels contain more detailed proofs.
 70    *
 71    * @param level Proof level.
 72    */
 73  89 public final void setLevel(final String level) {
 74  89 this.level = level;
 75    }
 76   
 77    /**
 78    * Set LaTeX text for non formal proof.
 79    *
 80    * @param nonFormalProof
 81    */
 82  104 public final void setNonFormalProof(final LatexList nonFormalProof) {
 83  104 this.nonFormalProof = nonFormalProof;
 84    }
 85   
 86  615 public final LatexList getNonFormalProof() {
 87  615 return nonFormalProof;
 88    }
 89   
 90  137 public boolean equals(final Object obj) {
 91  137 if (!(obj instanceof ProofVo)) {
 92  8 return false;
 93    }
 94  129 final ProofVo other = (ProofVo) obj;
 95  129 return EqualsUtility.equals(getKind(), other.getKind())
 96    && EqualsUtility.equals(getLevel(), other.getLevel())
 97    && EqualsUtility.equals(getNonFormalProof(), other.getNonFormalProof());
 98    }
 99   
 100  119 public int hashCode() {
 101  119 return (getKind() != null ? getKind().hashCode() : 0)
 102  119 ^ (getLevel() != null ? 1 ^ getLevel().hashCode() : 0)
 103  119 ^ (getNonFormalProof() != null ? 2 ^ getNonFormalProof().hashCode() : 0);
 104    }
 105   
 106  90 public String toString() {
 107  90 return "Proof (" + getKind() + ", " + getLevel() + "): " + getNonFormalProof();
 108    }
 109   
 110    }