/* $Id: ProofBo.java,v 1.2 2005/06/15 16:11:46 m31 Exp $
 *
 * This file is part of the project "Hilbert II" - http://www.qedeq.org
 *
 * Copyright 2000-2005,  Michael Meyling <mime@qedeq.org>.
 *
 * "Hilbert II" is free software; you can redistribute
 * it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 */

package org.qedeq.kernel.bo.module;

import org.qedeq.kernel.base.module.LatexList;
import org.qedeq.kernel.base.module.Proof;
import org.qedeq.kernel.utility.EqualsUtility;


/**
 * Contains a proof for a proposition.
 *
 * TODO mime 20050220: add formal proof (with different classes?)
 *
 * @version $Revision: 1.2 $
 * @author  Michael Meyling
 */
public final class ProofBo implements Proof  {

    /** LaTeX text for non formal proof. */
    private LatexList nonFormalProof;

    /**
     * Constructs an empty proof.
     */
    public ProofBo() {
        // nothing to do
    }

    /**
     * Set LaTexText of non formal proof.
     *
     * @param   nonFormalProof  Non formal proof text.
     */
    public final void setNonFormalProof(final LatexList nonFormalProof) {
        this.nonFormalProof = nonFormalProof;
    }

    public final LatexList getNonFormalProof() {
        return nonFormalProof;
    }

    public boolean equals(final Object obj) {
        if (!(obj instanceof ProofBo)) {
            return false;
        }
        final ProofBo other = (ProofBo) obj;
        return  EqualsUtility.equals(getNonFormalProof(), other.getNonFormalProof());
    }

    public int hashCode() {
        return (getNonFormalProof() != null ? getNonFormalProof().hashCode() : 0);
    }

    public String toString() {
        return "Proof: " + getNonFormalProof();
    }

}
