2004-11-14 | Paul Boddie | file changeset files shortlog | Adjusted the dispatcher method code, adding comments, where the only real changes are the removal of pop_top at the end of the code for testing each method (since it had been assumed that the iterator was still on the stack, but it was probably something else) and the moving of setup_loop upwards before the preparation of the argument-to-type mapping. |
paul@20 | 1 | public class ValueSubclass extends Value { |
paul@30 | 2 | public Value tmp; |
paul@20 | 3 | |
paul@28 | 4 | /** |
paul@28 | 5 | * Test of subclass initialisation with super usage and foreign object initialisation. |
paul@28 | 6 | */ |
paul@20 | 7 | public ValueSubclass(int x) { |
paul@20 | 8 | super(x); |
paul@30 | 9 | tmp = new Value(42); |
paul@28 | 10 | } |
paul@28 | 11 | |
paul@28 | 12 | /** |
paul@28 | 13 | * Test of overriding. |
paul@28 | 14 | */ |
paul@28 | 15 | public void setValue(int x) { |
paul@28 | 16 | this.value = -x; |
paul@28 | 17 | } |
paul@28 | 18 | |
paul@28 | 19 | /** |
paul@28 | 20 | * Test of overriding and super methods. |
paul@28 | 21 | */ |
paul@28 | 22 | public int add(int x) { |
paul@28 | 23 | return super.add(-x); |
paul@28 | 24 | } |
paul@28 | 25 | |
paul@28 | 26 | /** |
paul@28 | 27 | * Test of objects as arguments. |
paul@28 | 28 | */ |
paul@28 | 29 | public void setValueObject(Value v) { |
paul@28 | 30 | this.value = v.getValue(); |
paul@20 | 31 | } |
paul@20 | 32 | } |