KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > jemacs > lang > CatchableException


1 package gnu.jemacs.lang;
2
3 /** An exception thrown by (throw tag value) and caught by (catch tag body). */
4
5 public class CatchableException extends RuntimeException JavaDoc
6 {
7   Object JavaDoc tag;
8   Object JavaDoc value;
9
10   public CatchableException (Object JavaDoc tag, Object JavaDoc value)
11   {
12     this.tag = tag;
13     this.value = value;
14   }
15
16   public Object JavaDoc match (Object JavaDoc catchTag)
17   {
18     if (tag != catchTag)
19       throw this;
20     return value;
21   }
22 }
23
Popular Tags