FileDocCategorySizeDatePackage
MyCustomException.javaAPI DocExample1869Sun Dec 14 22:47:32 GMT 2003oreilly.hcj.exceptions

MyCustomException

public class MyCustomException extends Exception
A custom exception class used for demonstration purposes.
author
Robert Simmons jr. (kraythe)
version
$Revision: 1.4 $

Fields Summary
public static final int
GUI_ERROR
Constant for a transaction error.
public static final int
NO_RESERVATION
Constant for a transaction error.
public static final int
TRANSACTION_ERROR
Constant for a transaction error.
public static final int
BILLING_ERROR
Constant for a billing error.
public static final int
CREDIT_CARD_DECLINED
Constant for credit card declined.
final int
type
The type of exception.
Constructors Summary
public MyCustomException(int type)
Creates a new MyCustomException object.

param
type The type of error.
throws
IllegalArgumentException If the type given is invalid.


	                    	 
	    
		if ((type != GUI_ERROR) && (type != NO_RESERVATION)
		    && (type != TRANSACTION_ERROR) && (type != BILLING_ERROR)
		    && (type != CREDIT_CARD_DECLINED)) {
			throw new IllegalArgumentException();
		}
		this.type = type;
	
Methods Summary
public intgetType()
Get the exception type.

return
type The exception type.

		return this.type;