1 19 20 package org.netbeans.api.java.source.transform; 21 22 import com.sun.source.tree.Tree; 23 import java.util.LinkedList ; 24 import java.util.Map ; 25 26 30 public class ChangeList extends LinkedList <Change> implements Change { 31 String name; 32 33 public ChangeList(String refactoringName) { 34 super(); 35 name = refactoringName; 36 } 37 38 41 public String getRefactoringName() { 42 return name; 43 } 44 45 49 public Tree getChange(Tree oldTree) { 50 for (Change item : this) { 51 Tree t = item.getChange(oldTree); 52 if (t != null) 53 return t; 54 } 55 return null; 56 } 57 58 62 public Tree getOriginal(Tree newTree) { 63 for (Change item : this) { 64 Tree t = item.getOriginal(newTree); 65 if (t != null) 66 return t; 67 } 68 return null; 69 } 70 71 74 public boolean hasChange(Tree old) { 75 for (Change item : this) { 76 if (item.hasChange(old)) 77 return true; 78 } 79 return false; 80 } 81 82 85 public boolean hasOriginal(Tree newTree) { 86 for (Change item : this) { 87 if (item.hasOriginal(newTree)) 88 return true; 89 } 90 return false; 91 } 92 93 96 public void addToMap(Map <Tree,Tree> map) { 97 for (Change ch : this) 98 ch.addToMap(map); 99 } 100 } 101 | Popular Tags |