/* * SolveException.java * * * Copyright (c) 2004 David Hjelm . * * * Project homepage: . * * This program 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ package se.gu.ling.trindikit.oaa.common; /** Wrapper class for exceptions thrown by OAASolvers' solve methods. Includes * the exception and the OAASolver that did throw it. By letting it extend * RuntimeException it does not need to be reported for those cases when * solve methods do not throw exceptions. @author David Hjelm @version February 2003 */ public class SolveException extends RuntimeException{ Exception realException; OAASolver originator; /** @param s typically the solver that threw the exception @param e the exception */ public SolveException(OAASolver s,Exception e){ realException = e; originator = s; } /** Returns the message of the exception encapsulated by this SolveException */ public String getMessage(){ return realException.getMessage(); } /** Returns exception encapsulated by this SolveException */ public Exception getException(){ return realException; } /** Returns the solver associated with this SolveException. Typically this is the solver that threw the encapsulated exception. */ public OAASolver getOrigin(){ return originator; } }