1 19 package org.netbeans.modules.java.classpath; 20 21 import java.util.List ; 22 import java.beans.PropertyChangeListener ; 23 import java.net.URL ; 24 25 import java.util.ArrayList ; 26 import java.util.Collections ; 27 import java.util.Iterator ; 28 29 import org.netbeans.spi.java.classpath.ClassPathImplementation; 30 import org.netbeans.spi.java.classpath.PathResourceImplementation; 31 32 33 public class SimpleClassPathImplementation implements ClassPathImplementation { 34 35 List <? extends PathResourceImplementation> entries; 36 37 public SimpleClassPathImplementation() { 38 this(new ArrayList <PathResourceImplementation>()); 39 } 40 41 public SimpleClassPathImplementation(List <? extends PathResourceImplementation> entries) { 42 this.entries = entries; 43 } 44 45 public List <? extends PathResourceImplementation> getResources() { 46 return Collections.unmodifiableList(entries); 47 } 48 49 public void addPropertyChangeListener(PropertyChangeListener listener) { 50 } 52 53 public void removePropertyChangeListener(PropertyChangeListener listener) { 54 } 56 57 public String toString () { 58 StringBuilder builder = new StringBuilder ("SimpleClassPathImplementation["); for (PathResourceImplementation impl : this.entries) { 60 URL [] roots = impl.getRoots(); 61 for (URL root : roots) { 62 builder.append (root.toExternalForm()); 63 builder.append (", "); } 65 } 66 builder.append ("]"); return builder.toString (); 68 } 69 } 70 | Popular Tags |