public static void f2DEC() throws Exception { Class[] variants = {D.class, C.class, B1.class}; String[] decoderNames = {"fooDEC", "fooDEC", "fooDEC"}; DLog.polyCall(variants, decoderNames); // int code = DLog.pop(2) ; // switch (code) { // case 0 : /* D */ D.fooDEC() ; break ; // case 1 : /* C */ C.fooDEC() ; break ; // case 2 : /* B1 */ B1.fooDEC() ; // } }
public static void main(String[] args) throws Exception { System.out.println("** TestPolymorph"); TLog.initializeLogger(); TestPolymorph z = new TestPolymorph(); z.f1(new A()); z.f1(new B1()); z.f1(new B2()); z.f1(new C()); z.f1(new D()); z.f2(new B1()); z.f2(new C()); z.f2(new D()); z.f3(new D()); DLog.initialize(TLog.getDebugLogCopy(), TLog.getDebugEventLogCopy()); DLog.DEBUG = true; DLog.printEncodedLog(); f1DEC(); f1DEC(); f1DEC(); f1DEC(); f1DEC(); f2DEC(); f2DEC(); f2DEC(); f3DEC(); DLog.tick(); DLog.closeDecoder(); DLog.printDebug(); }
public static void fooDEC() throws Exception { DLog.log("I am C.foo()", 19); }