01: package method;
02:
03: public class ExtractMethodTestFour {
04: public void action() {
05: System.out.println("Before");
06: KeyIterator key = new KeyIterator();
07:
08: while (key.isApplicable()) {
09: key.apply();
10: }
11: key.debug();
12:
13: System.out.println("After");
14: }
15:
16: public void process(KeyIterator key) {
17: System.out.println("Before");
18:
19: while (key.isApplicable()) {
20: key.apply();
21: }
22: key.debug();
23:
24: System.out.println("After");
25: }
26:
27: private Iterator iter;
28:
29: public void apply(KeyIterator iter) {
30: System.out.println("Before");
31:
32: while (iter.isApplicable()) {
33: iter.apply();
34: }
35: iter.debug();
36:
37: System.out.println("After");
38: }
39:
40: public void apply(LinkedList list) {
41: System.out.println("Before");
42:
43: for (Iterator iter = list.iterator(); iter.hasNext();) {
44: Object next = iter.next();
45: System.out.println("String: " + next.toString());
46: }
47:
48: System.out.println("After");
49: }
50: }
|