/** * removes the given LightSourceAnnotationLink from annotationLinks, allowing for recursion -- whether * or not the removal will call unlinkLightSource again <b>if loaded</b>. */ public void removeLightSourceAnnotationLink (ome.model.annotations.LightSourceAnnotationLink link, boolean bothSides) { if (! _loaded ) errorIfUnloaded(); if ( getAnnotationLinks() == null ) { throwNullCollectionException("AnnotationLinks"); } getAnnotationLinks().remove( link ); }
/** * unlinks all ome.model.annotations.Annotation instances from this instance. */ public void unlinkAnnotation (ome.model.annotations.Annotation removal) { if (! _loaded ) errorIfUnloaded(); java.util.Set<ome.model.annotations.LightSourceAnnotationLink> toRemove = findLightSourceAnnotationLink( removal ); java.util.Iterator<ome.model.annotations.LightSourceAnnotationLink> it = toRemove.iterator(); while ( it.hasNext() ) { removeLightSourceAnnotationLink( it.next(), true ); } }
/** * clears the set. */ public void clearAnnotationLinks() { if (! _loaded ) errorIfUnloaded(); java.util.List<ome.model.annotations.LightSourceAnnotationLink> list = new java.util.ArrayList<ome.model.annotations.LightSourceAnnotationLink>( getAnnotationLinks() ); for (ome.model.annotations.LightSourceAnnotationLink link : list) { removeLightSourceAnnotationLink( link, true ); } }
/** * Returns an unmodifiable collection-view */ public java.util.Collection<ome.model.annotations.LightSourceAnnotationLink> unmodifiableAnnotationLinks() { if (! _loaded ) errorIfUnloaded(); if ( getAnnotationLinks() == null ) { return java.util.Collections.emptyList(); } return java.util.Collections.unmodifiableCollection( getAnnotationLinks() ); }
return null; } else if (field.equals(ID)) { return getId(); } else if (field.equals(VERSION)) { return getVersion(); } else if (field.equals(MANUFACTURER)) { return getManufacturer(); } else if (field.equals(MODEL)) { return getModel(); } else if (field.equals(POWER)) { return getPower(); } else if (field.equals(LOTNUMBER)) { return getLotNumber(); } else if (field.equals(SERIALNUMBER)) { return getSerialNumber(); } else if (field.equals(INSTRUMENT)) { return getInstrument(); } else if (field.equals(ANNOTATIONLINKSCOUNTPEROWNER)) { return getAnnotationLinksCountPerOwner(); } else if (field.equals(ANNOTATIONLINKS)) { return getAnnotationLinks(); } else if (field.equals(DETAILS)) { return getDetails(); } else { if (_dynamicFields != null) {
public void setInstrument(ome.model.acquisition.Instrument instrument) { if (! _loaded ) errorIfUnloaded(); this.instrument = instrument; } protected java.util.Set<ome.model.annotations.LightSourceAnnotationLink> annotationLinks = new java.util.HashSet<ome.model.annotations.LightSourceAnnotationLink>();
/** * Main constructor. */ public LightSource (Long id, boolean loaded) { setId(id); if (loaded) { getDetails().setContext(this); } else { if (this.id == null) { throw new ApiUsageException("Id cannot be null for a proxy"); } unload(); } }
/** * 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; }
/** * 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; }
/** * Adds a ome.model.annotations.LightSourceAnnotationLink to annotationLinks . This entails changing our annotationLinks Set, * creating a new ome.model.annotations.LightSourceAnnotationLink and calling linkAnnotation on the ome.model.annotations.Annotation. */ public ome.model.annotations.LightSourceAnnotationLink linkAnnotation (ome.model.annotations.Annotation addition) { if (! _loaded ) errorIfUnloaded(); // Setup link ome.model.annotations.LightSourceAnnotationLink link = new ome.model.annotations.LightSourceAnnotationLink(); link.link( this, addition ); // Add it to us and possibly the other side. addLightSourceAnnotationLink( link, true ); return link; }
@Override public boolean acceptFilter(ome.util.Filter __filter){ try { return super.acceptFilter(__filter); } catch (RuntimeException re) { // ticket:1183 - Caused by Utils.trueClass(Annotation.class) if (re.getCause() instanceof InstantiationException) { this.unload(); return true; } else { throw re; } } }
} else if (LightSource.class.isAssignableFrom(kls)) { LightSource obj = (LightSource) s.get(LightSource.class, objId); return imagesContainsInstrument(s, images, obj.getInstrument(), obToImageCache); } else if (Laser.class.isAssignableFrom(kls)) { objId); return imagesContainsInstrument(s, images, obj.getLightSource() .getInstrument(), obToImageCache); } else if (DetectorSettings.class.isAssignableFrom(kls)) { DetectorSettings obj = (DetectorSettings) s.get(
public void setManufacturer(java.lang.String manufacturer) { if (! _loaded ) errorIfUnloaded(); this.manufacturer = (java.lang.String) manufacturer; } protected java.lang.String model = null;
/** * should be used rather than accessing the annotationLinks set directly. * This method will never return null, but rather will return an instance * of {@link ome.util.EmptyIterator}. To test for a null collection, * see of {@link #sizeOfAnnotationLinks()} is less than zero. */ public java.util.Iterator<ome.model.annotations.LightSourceAnnotationLink> iterateAnnotationLinks() { if (! _loaded ) errorIfUnloaded(); if ( getAnnotationLinks() == null ) { return new ome.util.EmptyIterator<ome.model.annotations.LightSourceAnnotationLink>(); } return getAnnotationLinks().iterator(); // TODO should this be direct access }
/** * 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; }
/** * 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; }
@Override public boolean acceptFilter(ome.util.Filter __filter){ try { this.map = (java.util.List<ome.model.internal.NamedValue>) __filter.filter(MAP, this.map ); return super.acceptFilter(__filter); } catch (RuntimeException re) { // ticket:1183 - Caused by Utils.trueClass(Annotation.class) if (re.getCause() instanceof InstantiationException) { this.unload(); return true; } else { throw re; } } }
/** * Adds a ome.model.annotations.LightSourceAnnotationLink to annotationLinks, allowing for recursion -- whether * or not addLightSourceAnnotationLink will be called on the addition <b>if it is loaded</b> */ public void addLightSourceAnnotationLink (ome.model.annotations.LightSourceAnnotationLink link, boolean bothSides) { if (! _loaded ) errorIfUnloaded(); if ( getAnnotationLinks() == null ) { throwNullCollectionException("AnnotationLinks"); } getAnnotationLinks().add( link ); }
public void setSerialNumber(java.lang.String serialNumber) { if (! _loaded ) errorIfUnloaded(); this.serialNumber = (java.lang.String) serialNumber; } protected ome.model.acquisition.Instrument instrument = null;