1 11 package org.eclipse.core.internal.resources.mapping; 12 13 import org.eclipse.core.resources.IResource; 14 import org.eclipse.core.resources.IResourceVisitor; 15 import org.eclipse.core.runtime.CoreException; 16 17 33 public class ResourceTraversal { 34 35 private int depth; 36 private int flags; 37 private IResource[] resources; 38 39 46 public ResourceTraversal(IResource[] resources, int depth) { 47 this(resources, depth, 0); 48 } 49 50 57 public ResourceTraversal(IResource[] resources, int depth, int flags) { 58 this.resources = resources; 59 this.depth = depth; 60 this.flags = flags; 61 } 62 63 73 public void accept(IResourceVisitor visitor) throws CoreException { 74 for (int i = 0; i < resources.length; i++) { 75 IResource resource = resources[i]; 76 resource.accept(visitor, depth, flags); 77 } 78 } 79 80 87 public int getDepth() { 88 return depth; 89 } 90 91 102 public int getFlags() { 103 return flags; 104 } 105 106 119 public IResource[] getResources() { 120 return resources; 121 } 122 } 123 | Popular Tags |