1 16 package org.apache.cocoon.portal.pluto.om.common; 17 18 import java.util.Iterator ; 19 20 26 public class ResourceRefSet 27 extends AbstractSupportSet 28 implements java.io.Serializable , Support { 29 30 33 public ResourceRef get(String name) { 34 Iterator it = this.iterator(); 35 while(it.hasNext()) { 36 ResourceRef ref = (ResourceRef)it.next(); 37 if(ref.getName().equals(name)) { 38 return ref; 39 } 40 } 41 return null; 42 } 43 44 public ResourceRef add(ResourceRef ref) { 45 return this.add(ref); 46 } 47 48 public ResourceRef remove(ResourceRef ref) { 49 Iterator it = this.iterator(); 50 while(it.hasNext()) { 51 ResourceRef internal = (ResourceRef)it.next(); 52 if(internal.equals(ref)) { 53 it.remove(); 54 return internal; 55 } 56 } 57 return null; 58 } 59 } 60 | Popular Tags |