001 /* This file is part of the project "Hilbert II" - http://www.qedeq.org
002 *
003 * Copyright 2000-2011, Michael Meyling <mime@qedeq.org>.
004 *
005 * "Hilbert II" is free software; you can redistribute
006 * it and/or modify it under the terms of the GNU General Public
007 * License as published by the Free Software Foundation; either
008 * version 2 of the License, or (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013 * GNU General Public License for more details.
014 */
015
016 package org.qedeq.kernel.se.dto.module;
017
018 import org.qedeq.base.utility.EqualsUtility;
019 import org.qedeq.kernel.se.base.module.LatexList;
020 import org.qedeq.kernel.se.base.module.Proof;
021
022
023 /**
024 * Contains a non formal proof for a proposition or rule.
025 *
026 * @author Michael Meyling
027 */
028 public class ProofVo implements Proof {
029
030 /** Kind of proof. */
031 private String kind;
032
033 /** Proof detail level. */
034 private String level;
035
036 /** LaTeX text for non formal proof. */
037 private LatexList nonFormalProof;
038
039 /**
040 * Constructs an empty proof.
041 */
042 public ProofVo() {
043 // nothing to do
044 }
045
046 public String getKind() {
047 return kind;
048 }
049
050 /**
051 * Set kind of proof. E.g. "informal".
052 *
053 * @param kind Set proof type.
054 */
055 public final void setKind(final String kind) {
056 this.kind = kind;
057 }
058
059 public String getLevel() {
060 return level;
061 }
062
063 /**
064 * Set proof level. Higher proof levels contain more detailed proofs.
065 *
066 * @param level Proof level.
067 */
068 public final void setLevel(final String level) {
069 this.level = level;
070 }
071
072 /**
073 * Set LaTeX text for non formal proof.
074 *
075 * @param nonFormalProof The proof text.
076 */
077 public final void setNonFormalProof(final LatexList nonFormalProof) {
078 this.nonFormalProof = nonFormalProof;
079 }
080
081 public final LatexList getNonFormalProof() {
082 return nonFormalProof;
083 }
084
085 public boolean equals(final Object obj) {
086 if (!(obj instanceof ProofVo)) {
087 return false;
088 }
089 final ProofVo other = (ProofVo) obj;
090 return EqualsUtility.equals(getKind(), other.getKind())
091 && EqualsUtility.equals(getLevel(), other.getLevel())
092 && EqualsUtility.equals(getNonFormalProof(), other.getNonFormalProof());
093 }
094
095 public int hashCode() {
096 return (getKind() != null ? getKind().hashCode() : 0)
097 ^ (getLevel() != null ? 1 ^ getLevel().hashCode() : 0)
098 ^ (getNonFormalProof() != null ? 2 ^ getNonFormalProof().hashCode() : 0);
099 }
100
101 public String toString() {
102 return "Proof (" + getKind() + ", " + getLevel() + "): " + getNonFormalProof();
103 }
104
105 }
|