1 46 47 package org.codehaus.groovy.classgen; 48 49 import org.codehaus.groovy.runtime.InvokerHelper; 50 51 52 53 60 public class DumpClass3 extends DumpClass2 { 61 62 String blah; 63 Object another; 64 65 public DumpClass3(Object foo) { 66 super(foo); 67 this.blah = (String ) foo; 68 } 69 70 public void foo() { 71 Object x = new Integer (12); 72 73 if (x instanceof DumpClass2) { 74 System.out.println("Hello"); 75 } 76 } 77 78 public void testAnd() { 79 if (InvokerHelper.asBool(blah) && InvokerHelper.asBool(another)) { 80 System.out.println("Hello!"); 81 } 82 else { 83 System.out.println("False"); 84 } 85 } 86 87 public Object testWhile(Object x, Object m) { 88 while ( InvokerHelper.compareLessThan(x, m)) { 89 x = increment(x); 90 } 91 return x; 92 } 93 94 private Object increment(Object x) { 95 return null; 97 } 98 99 public Object testSuper() { 100 return super.getFoo(); 101 } 102 } 103 | Popular Tags |