1 19 20 package org.netbeans.api.java.source.transform; 21 22 import com.sun.source.tree.Tree; 23 import java.util.Map ; 24 25 28 public class TreeChange implements Change { 29 private Tree oldTree; 30 private Tree newTree; 31 32 public TreeChange(Tree oldTree, Tree newTree) { 33 this.oldTree = oldTree; 34 this.newTree = newTree; 35 } 36 37 41 public Tree getChange(Tree oldTree) { 42 return (this.oldTree == oldTree) ? newTree : null; 43 } 44 45 49 public Tree getOriginal(Tree newTree) { 50 return (this.newTree == newTree) ? oldTree : null; 51 } 52 53 56 public boolean hasChange(Tree old) { 57 return (this.oldTree == oldTree); 58 } 59 60 63 public boolean hasOriginal(Tree newTree) { 64 return (this.newTree == newTree); 65 } 66 67 70 public void addToMap(Map <Tree,Tree> map) { 71 map.put(oldTree, newTree); 72 } 73 } 74 | Popular Tags |