// $Id: AbstractArgumentAtom.java,v 1.5 2004/06/14 16:12:22 m31 Exp $
//
// This file is part of the program suite "Principia Mathematica II"
// which is a working prototype for the main project:
// "Hilbert II" - http://www.qedeq.org
//
// Copyright 2001-2004  Michael Meyling <mime@qedeq.org>.
//
// "Principia Mathematica 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 com.meyling.principia.argument;


/**
 * Every Atom must inherit from this class. Its main function is to
 * provide the standard implemention of {@link #equals}, {@link #matches}
 * and {@link #hashCode}.
 *
 * @version $Revision: 1.5 $
 * @author  Michael Meyling
 */
public abstract class AbstractArgumentAtom
        extends AbstractArgument implements Argument {


    /**
     * @inherited
     * @return always 0
     */
    public int getArgumentSize() {
        return 0;
    }


    /**
     * @inherited
     * @param   i   number of argument
     * @return  will never return anything, this is an Atom
     * @throws  IllegalArgumentException will always be thrown
     */
    public Argument getArgument(int i)
            throws IllegalArgumentException {
        throw new IllegalArgumentException(
            ArgumentConstants.NO_ARGUMENT_NUMBER);
    }


    /** @inherited */
    public abstract boolean equals(Object object);


    /** @inherited */
    public abstract Argument copy();


    /** @inherited */
    public final Argument create(final Argument[] arguments) {
        throw new IllegalArgumentException("Programming error");
    }


    /** @inherited */
    public abstract String toString();

}
