/** * unlinks all ome.model.containers.Folder instances from this instance. */ public void unlinkFolder (ome.model.containers.Folder removal) { if (! _loaded ) errorIfUnloaded(); java.util.Set<ome.model.containers.FolderRoiLink> toRemove = findFolderRoiLink( removal ); java.util.Iterator<ome.model.containers.FolderRoiLink> it = toRemove.iterator(); while ( it.hasNext() ) { removeFolderRoiLink( it.next(), true ); } }
/** * clears the set. */ public void clearFolderLinks() { if (! _loaded ) errorIfUnloaded(); java.util.List<ome.model.containers.FolderRoiLink> list = new java.util.ArrayList<ome.model.containers.FolderRoiLink>( getFolderLinks() ); for (ome.model.containers.FolderRoiLink link : list) { removeFolderRoiLink( link, true ); } }
/** * removes the given FolderRoiLink from roiLinks, allowing for recursion -- whether * or not the removal will call unlinkFolder again <b>if loaded</b>. */ public void removeFolderRoiLink (ome.model.containers.FolderRoiLink link, boolean bothSides) { if (! _loaded ) errorIfUnloaded(); if ( getRoiLinks() == null ) { throwNullCollectionException("RoiLinks"); } getRoiLinks().remove( link ); if ( bothSides && link.child().isLoaded() ) { link.child().removeFolderRoiLink( link, false ); } }