1 package com.teamkonzept.lib.math; 2 3 4 public class BadOperandTypeException extends Exception { 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 found; 12 String wished; 13 Object caller; 14 15 public BadOperandTypeException(Object target, 16 String shouldBe){ 17 found = target.getClass(); 18 wished = shouldBe; 19 } 20 21 public String toString(){ 22 return "found an operand of type " + found 23 + " where " + wished + " was expected"; 24 } 25 } 26 | Popular Tags |