1 19 20 package org.netbeans.modules.java.source.engine; 21 22 import com.sun.source.tree.CompilationUnitTree; 23 import com.sun.source.tree.Tree; 24 import com.sun.source.tree.TreeVisitor; 25 import java.util.ArrayList ; 26 import java.util.List ; 27 28 34 public final class RootTree implements Tree, Cloneable { 35 List <CompilationUnitTree> units; 36 37 public RootTree(List <CompilationUnitTree> units) { 38 if (units == null) 39 throw new IllegalArgumentException ("null units"); 40 this.units = units; 41 } 42 43 47 public List <CompilationUnitTree> getCompilationUnits() { 48 return units; 49 } 50 51 public Kind getKind() { 52 return Kind.OTHER; 53 } 54 55 public <R, D> R accept(TreeVisitor<R, D> arg0, D arg1) { 56 R r = null; 59 for (CompilationUnitTree unit : units) { 60 r = unit.accept(arg0, arg1); 61 } 62 return r; 63 } 64 65 public Object clone() { 66 return new RootTree(new ArrayList <CompilationUnitTree>(units)); 67 } 68 } 69 | Popular Tags |