01: package argparser;
02:
03: import java.io.IOException;
04:
05: /**
06: * Exception class used by <code>StringScanner</code> when
07: * command line arguments do not parse correctly.
08: *
09: * @author John E. Lloyd, Winter 2001
10: * @see StringScanner
11: */
12: class StringScanException extends IOException {
13: int failIdx;
14:
15: /**
16: * Creates a new StringScanException with the given message.
17: *
18: * @param msg Error message
19: * @see StringScanner
20: */
21:
22: public StringScanException(String msg) {
23: super (msg);
24: }
25:
26: public StringScanException(int idx, String msg) {
27: super (msg);
28: failIdx = idx;
29: }
30:
31: public int getFailIndex() {
32: return failIdx;
33: }
34: }
|