Methods Summary |
---|
public void | addResource(J2EEResource resource)
Map resourceSet = getResourcesInternal(resource.getType());
resourceSet.put(resource.getName(), resource);
|
public java.util.Set | getAllResources()
Set allResources = new HashSet();
Collection resourcesByType = resourceSets_.values();
for(Iterator iter = resourcesByType.iterator(); iter.hasNext(); ) {
HashMap next = (HashMap) iter.next();
allResources.addAll(next.values());
}
return allResources;
|
public J2EEResource | getResourceByName(int type, java.lang.String resourceName)
Map resourceSet = getResourcesInternal(type);
return (J2EEResource) resourceSet.get(resourceName);
|
public java.util.Set | getResourcesByType(int type)
Map resourceSet = getResourcesInternal(type);
Collection collection = resourceSet.values();
Set shallowCopy = new HashSet();
for(Iterator iter = collection.iterator(); iter.hasNext();) {
J2EEResource next = (J2EEResource) iter.next();
shallowCopy.add(next);
}
return shallowCopy;
|
private java.util.Map | getResourcesInternal(int type)
Map resourceSet = (Map) resourceSets_.get(new Integer(type));
if( resourceSet == null ) {
resourceSet = new HashMap();
resourceSets_.put(new Integer(type), resourceSet);
}
return resourceSet;
|
public void | removeAllResourcesByType(int type)
resourceSets_.remove(new Integer(type));
|
public boolean | removeResource(J2EEResource resource)
Map resourceSet = getResourcesInternal(resource.getType());
boolean removed =
(resourceSet.remove(resource.getName()) != null);
return removed;
|