|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.princeton.toy.lang.TDefaultExceptionHandler
TDefaultExceptionHandler is the simplest mutable implementation of TExceptionHandler.
| Field Summary |
| Fields inherited from interface edu.princeton.toy.lang.TExceptionHandler |
PROMISCUOUS_EXCEPTION_HANDLER, PRUDISH_EXCEPTION_HANDLER |
| Constructor Summary | |
TDefaultExceptionHandler()
Instantiates a new TDefaultExceptionHandler in an exceptionless state. |
|
| Method Summary | |
boolean |
getWillThrow(int index)
Gets wheter or not the handler should throw a raised exception of the specified type. |
boolean |
getWillThrow(TExceptionType type)
Gets wheter or not the handler should throw a raised exception of the specified type. |
void |
raise(TExceptionType type)
Throws a TException with the specified type iff the specified exception was not set to be ignored. |
void |
setWillThrow(int index,
boolean willThrow)
Sets wheter or not the handler should throw a raised exception of the specified type. |
void |
setWillThrow(TExceptionType type,
boolean willThrow)
Sets wheter or not the handler should throw a raised exception of the specified type. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TDefaultExceptionHandler()
| Method Detail |
public void raise(TExceptionType type)
throws TException
raise in interface TExceptionHandlertype - The type of exceptional condition that was raised in the Virtual Machine.
TExceptionpublic boolean getWillThrow(int index)
getWillThrow in interface TExceptionHandlerindex - The index of type (in the TExceptionType.TYPES array) in question. An invalid
value will result in an ArrayIndexOutOfBoundsException.
TExceptionType.TYPESpublic boolean getWillThrow(TExceptionType type)
getWillThrow in interface TExceptionHandlerTExceptionType.TYPES
public void setWillThrow(TExceptionType type,
boolean willThrow)
willThrow - Wheter or not the handler should throw exceptions of this type.TExceptionType.TYPES
public void setWillThrow(int index,
boolean willThrow)
index - The index of type (in the TExceptionType.TYPES array) in question. An invalid
value will result in an ArrayIndexOutOfBoundsException.willThrow - Wheter or not the handler should throw exceptions of this type.TExceptionType.TYPES
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||