/* 57 */ return new AddConstToCollectionOpImage((Collection)args.getSource(0), hints, (double[])args.getObjectParameter(0));
/* */ }
/* */
/* */ public CollectionImage update(ParameterBlock oldParamBlock, RenderingHints oldHints, ParameterBlock newParamBlock, RenderingHints newHints, CollectionImage oldRendering, CollectionOp op)
/* */ {
/* 72 */ CollectionImage updatedCollection = null;
/* */
/* 74 */ if ((oldParamBlock.getObjectParameter(0).equals(newParamBlock.getObjectParameter(0))) && (oldHints == null ? newHints == null : oldHints.equals(newHints)))
/* */ {
/* 78 */ Collection oldSource = (Collection)oldParamBlock.getSource(0);
/* 79 */ Collection newSource = (Collection)newParamBlock.getSource(0);
/* 80 */ double[] constants = (double[])oldParamBlock.getObjectParameter(0);
/* */
/* 83 */ Collection commonSources = new ArrayList();
/* 84 */ Iterator it = oldSource.iterator();
/* 85 */ while (it.hasNext()) {
/* 86 */ Object oldElement = it.next();
/* 87 */ if (newSource.contains(oldElement)) {
/* 88 */ commonSources.add(oldElement);
/* */ }
/* */ }
/* */
/* 92 */ if (commonSources.size() != 0)
/* */ {
/* 95 */ ArrayList commonNodes = new ArrayList(commonSources.size());
/* 96 */ it = oldRendering.iterator();
/* 97 */ while (it.hasNext()) {
/* 98 */ RenderedOp node = (RenderedOp)it.next();
/* 99 */ PlanarImage source = node.getSourceImage(0);
/* 100 */ if (commonSources.contains(source)) {
/* 101 */ commonNodes.add(node);
/* */ }
/* */
/* */ }
/* */
/* 106 */ updatedCollection = new AddConstToCollectionOpImage(newSource, newHints, constants);
/* */
/* 112 */ ArrayList newNodes = new ArrayList(oldRendering.size() - commonSources.size());
/* */
/* 114 */ it = updatedCollection.iterator();
/* 115 */ while (it.hasNext()) {
/* 116 */ RenderedOp node = (RenderedOp)it.next();
/* 117 */ PlanarImage source = node.getSourceImage(0);
/* 118 */ if (commonSources.contains(source)) {
/* 119 */ it.remove();
/* */ }
/* */
/* */ }
/* */
/* 124 */ it = commonNodes.iterator();
/* 125 */ while (it.hasNext()) {
/* 126 */ updatedCollection.add(it.next());
/* */ }
/* */ }
/* */ }
/* */
/* 131 */ return updatedCollection;