01: /*************************************************************************
02: * *
03: * 1) This source code file, in unmodified form, and compiled classes *
04: * derived from it can be used and distributed without restriction, *
05: * including for commercial use. (Attribution is not required *
06: * but is appreciated.) *
07: * *
08: * 2) Modified versions of this file can be made and distributed *
09: * provided: the modified versions are put into a Java package *
10: * different from the original package, edu.hws; modified *
11: * versions are distributed under the same terms as the original; *
12: * and the modifications are documented in comments. (Modification *
13: * here does not include simply making subclasses that belong to *
14: * a package other than edu.hws, which can be done without any *
15: * restriction.) *
16: * *
17: * David J. Eck *
18: * Department of Mathematics and Computer Science *
19: * Hobart and William Smith Colleges *
20: * Geneva, New York 14456, USA *
21: * Email: eck@hws.edu WWW: http://math.hws.edu/eck/ *
22: * *
23: *************************************************************************/package edu.hws.jcm.awt;
24:
25: /**
26: * JCMErrors can be generated by objects belonging to various classes
27: * in edu.hws.jcm.awt and edu.hws.jcm.draw. A JCMError can have an
28: * associated object, which is generally a ParseContext, InputObject,
29: * or Computable.
30: *
31: * @author David Eck
32: */
33: public class JCMError extends RuntimeException {
34: /**
35: * Object, possibly null, associated with this error.
36: */
37: public Object object;
38:
39: /**
40: * Create a JCMError with the given error message and no associated object.
41: *
42: * @param message the error message associated with this JCMError.
43: */
44: public JCMError(String message) {
45: this (message, null);
46: }
47:
48: /**
49: * Create a JCMError with the given error message and associated object.
50: *
51: * @param message the error message associated with this JCMError.
52: * @param object the object associated with this JCMError.
53: */
54: public JCMError(String message, Object object) {
55: super(message);
56: this.object = object;
57: }
58: }
|