KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > teamkonzept > lib > math > BadOperandTypeException


1 package com.teamkonzept.lib.math;
2
3
4 public class BadOperandTypeException extends Exception JavaDoc{
5
6     final static int SYNTAX_ERROR = 0;
7     final static int MISSING_OPENING_PAREN = 1;
8     final static int MISSING_CLOSING_PAREN = 2;
9     final static int UNKNOWN_RESULT = 3;
10     
11     Class JavaDoc found;
12     String JavaDoc wished;
13     Object JavaDoc caller;
14
15     public BadOperandTypeException(Object JavaDoc target,
16                    String JavaDoc shouldBe){
17     found = target.getClass();
18     wished = shouldBe;
19     }
20
21     public String JavaDoc toString(){
22     return "found an operand of type " + found
23         + " where " + wished + " was expected";
24     }
25 }
26
Popular Tags