|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.java.classpath; import org.netbeans.spi.java.classpath.ClassPathImplementation; import org.netbeans.spi.java.classpath.PathResourceImplementation; import java.util.List; import java.util.ArrayList; import java.util.Iterator; import java.util.Collections; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; /** ProxyClassPathImplementation provides read only proxy for ClassPathImplementations. * The order of the resources is given by the order of its delegates. * The proxy is designed to be used as a union of class paths. * E.g. to be able to easily iterate or listen on all design resources = sources + compile resources */ public class ProxyClassPathImplementation implements ClassPathImplementation { private ClassPathImplementation[] classPaths; private List resourcesCache; private ArrayList listeners; public ProxyClassPathImplementation (ClassPathImplementation[] classPaths) { if (classPaths == null) throw new IllegalArgumentException (); List impls = new ArrayList (); PropertyChangeListener l = new DelegatesListener (); for (int i=0; i< classPaths.length; i++) { if (classPaths[i] == null) continue; classPaths[i].addPropertyChangeListener (l); impls.add (classPaths[i]); } this.classPaths = (ClassPathImplementation[]) impls.toArray(new ClassPathImplementation[impls.size()]); } public synchronized List /* |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.