// $Id: ParsingException.java,v 1.6 2004/03/16 18:23:17 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.io;


/**
 * This is a construction (and checking) exception for arguments.
 *
 * @version $Revision: 1.6 $
 * @author  Michael Meyling
 */
public class ParsingException extends Exception {


    /** exception code */
    private final int code;

    /** description of reason for exception */
    private final String description;

    /** source position of problem */
    private final int row;

    /** source position of problem */
    private final int column;

    /** source position of problem */
    private final int position;

    /** problematic line */
    private final String line;

    /** address of problematic module */
    private final String address;


    /**
     * Constructs an argument exception.
     *
     * @param  code         exception cathegory
     * @param  description  what is the problem
     * @param  row          row number of problem
     * @param  column       column number of problem
     * @param  line         problematic line
     * @param  address      address that describes the module location
     */
    public ParsingException(final int code, final String description,
            final int row, final int column, final int position,
            final String line, final String address) {
        super(description);
        this.code = code;
        this.description = description;
        this.row = row;
        this.column = column;
        this.position = position;
        this.line = line;
        this.address = address;
    }


    /**
     * Get exception code.
     *
     * @return  exception code
     */
    public final int getCode() {
        return this.code;
    }


    /**
     * Get exception description.
     *
     * @return  exception description
     */
    public final String getDescription() {
        return this.description;
    }


    /**
     * Get row number of problem.
     *
     * @return  problem row position
     */
    public final int getRow() {
        return this.row;
    }


    /**
     * Get problem column position.
     *
     * @return  problem position
     */
    public final int getColumn() {
        return this.column;
    }


    /**
     * Get problematic source line.
     *
     * @return  source line
     */
    public final String getLine() {
        return this.line;
    }


    /**
     * Get address of problematic module.
     *
     * @return  address of problematic module
     */
    public final String getAddress() {
        return this.address;
    }


    /**
     * Get position of problem.
     * 
     * @return  position;
     */
    public int getPosition() {
        return this.position;
    }

}
