/* $Id: ProofVo.java,v 1.3 2005/06/15 16:11:47 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.dto.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
 *
 * @version $Revision: 1.3 $
 * @author  Michael Meyling
 */
public final class ProofVo implements Proof  {

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

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

    /**
     * Set LaTeX text for non formal proof.
     *
     * @param nonFormalProof
     */
    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 ProofVo)) {
            return false;
        }
        final ProofVo other = (ProofVo) obj;
        return  EqualsUtility.equals(getNonFormalProof(), other.getNonFormalProof());
    }

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

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

}
