/** * produces a {@link java.util.List}-copy of the underlying collection. Unlike, * {@link #linkedAnnotationIterator()}, while using the returned {@link java.util.List}, * modifications can be made to the underlying collection without throwing * {@link java.util.ConcurrentModificationException}. */ public java.util.List<ome.model.annotations.Annotation> linkedAnnotationList() { if (! _loaded ) errorIfUnloaded(); java.util.Iterator<ome.model.annotations.Annotation> it = linkedAnnotationIterator(); java.util.List<ome.model.annotations.Annotation> list = new java.util.ArrayList<ome.model.annotations.Annotation>(); while ( it.hasNext() ) { list.add( it.next() ); } return list; }
/** * takes a CBlock and calls the block once for each ome.model.annotations.Annotation while * collecting the results. If <code>block == null</code>, then the * iterator values themselves are collected. */ @SuppressWarnings("unchecked") public <E> java.util.List<E> eachLinkedAnnotation(ome.util.CBlock<E> block) { if (! _loaded ) errorIfUnloaded(); java.util.List<E> result = new java.util.ArrayList<E>(); java.util.Iterator<ome.model.annotations.Annotation> it = linkedAnnotationIterator(); while ( it.hasNext() ) { ome.model.annotations.Annotation obj = it.next(); if ( block != null ) { result.add( block.call( obj ) ); } else { result.add( (E) obj ); } } return result; }