Class MyException
- public class MyException
- extends RuntimeException
Title: CS187 - Project 2
Description: My exception class
Class GWU CS187: Design of User Interface
- Version:
- 1.0
- Author:
- Grace (Eun H.) Cho
MyException
public MyException(String pN,
String cN,
String mN,
String mes,
int errNum)
- Constructs a standard Game exception.
- Parameters:
cN - [className] of the method throwing the exception
mN - [methodName] of the method throwing the exception
mes - [message] a textual message describing the error
errNum - [errorNumber] a numeric value associated with the error message.
- Returns:
- An exception for phonBook package
- Author:
- Grace Cho
getPackageName
public String getPackageName()
- Retrieves the packageName from a standard Game exception.
- Returns:
- The name of the package as a String
For Class MyException, the package name is always 'phoneBook'.
- Author:
- Grace Cho
getClassName
public String getClassName()
- Retrieves the className from a standard Game exception.
- Returns:
- The name of the class as a String
- Author:
- Grace Cho
getMethodName
public String getMethodName()
- Retrieves the method name from a standard Game exception.
- Returns:
- The method name String
- Author:
- Grace Cho
getMessage
public String getMessage()
- Retrieves the error message from a standard Game exception.
- Returns:
- The error message String
- Author:
- Grace Cho
getErrorNumber
public int getErrorNumber()
- Retrieves the error number from a standard Game exception.
- Returns:
- The error message number (as an int)
- Author:
- Grace Cho
toString
public String toString()
- Returns a string formatted to display the MyException information. That information includes the Package, Class, Method, Error Message and Error Number associated with the exception that was thrown.
- Returns:
- string formatted to display the MyException information.
- Author:
- Grace Cho