/** * find all ome.model.annotations.LightSourceAnnotationLink which have the argument as their child. */ public java.util.Set<ome.model.annotations.LightSourceAnnotationLink> findLightSourceAnnotationLink( ome.model.annotations.Annotation target ) { if (! _loaded ) errorIfUnloaded(); final java.util.Iterator<ome.model.annotations.LightSourceAnnotationLink> it = iterateAnnotationLinks(); final java.util.Set<ome.model.annotations.LightSourceAnnotationLink> result = new java.util.HashSet<ome.model.annotations.LightSourceAnnotationLink>(); while ( it.hasNext() ) { ome.model.annotations.LightSourceAnnotationLink link = it.next(); if ( link.child() == target ) { result.add( link ); } } return result; }
/** * takes a CBlock and calls the block once for each ome.model.annotations.LightSourceAnnotationLink while * collecting the results. If <code>block == null</code>, then the * iterator values themselves are collected. This method uses * {@link #iterateAnnotationLinks} internally and so will return a value * even if the underlying collection is null. */ @SuppressWarnings("unchecked") public <E> java.util.List<E> collectAnnotationLinks(ome.util.CBlock<E> block) { if (! _loaded ) errorIfUnloaded(); java.util.List<E> result = new java.util.ArrayList<E>(); java.util.Iterator<ome.model.annotations.LightSourceAnnotationLink> it = iterateAnnotationLinks(); while ( it.hasNext() ) { IObject obj = (IObject) it.next(); if ( block != null ) { result.add( block.call( obj ) ); } else { result.add( (E) obj ); } } return result; }