1 8 14 package jfun.yan.lifecycle; 15 16 22 final class ExceptionPrinter implements ExceptionHandler { 23 private final java.io.PrintStream out; 24 25 ExceptionPrinter(final java.io.PrintStream out) { 26 this.out = out; 27 } 28 29 public void handle(Throwable th) { 30 th.printStackTrace(); 31 } 32 public boolean equals(Object obj) { 33 if(obj==this) return true; 34 if(obj instanceof ExceptionPrinter){ 35 final ExceptionPrinter eh2 = (ExceptionPrinter)obj; 36 return out.equals(eh2.out); 37 } 38 else return false; 39 } 40 public int hashCode() { 41 return out.hashCode(); 42 } 43 public String toString() { 44 return out.toString(); 45 } 46 } 47 | Popular Tags |