4900N/A * Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * This class defines a node on a linked list of ImageObservers. 0N/A * The base class defines the dummy implementation used for the 0N/A * last link on all chains and a subsequent subclass then 0N/A * defines the standard implementation that manages a weak 0N/A * reference to a real ImageObserver. 0N/A * Check if iw is the referent of this Link or any 0N/A * subsequent Link objects on this chain. 0N/A return false;
// No "iw" down here. 0N/A * Remove this Link from the chain if its referent 0N/A * is the indicated target or if it has been nulled 0N/A * out by the garbage collector. 0N/A * Return the new remainder of the chain. 0N/A * The argument may be null which will trigger 0N/A * the chain to remove only the dead (null) links. 0N/A * This method is only ever called inside a 0N/A * synchronized block so Link.next modifications 0N/A return this;
// Leave me as the end link. 0N/A * Deliver the indicated image update information 0N/A * to the referent of this Link and return a boolean 0N/A * indicating whether or not some referent became 0N/A * null or has indicated a lack of interest in 0N/A * further updates to its imageUpdate() method. 0N/A * This method is not called inside a synchronized 0N/A * block so Link.next modifications are not safe. 0N/A int x,
int y,
int w,
int h)
0N/A return false;
// No disinterested parties down here. 0N/A * Standard Link implementation to manage a Weak Reference 0N/A * to an ImageObserver. 0N/A // Remove me from the chain, but continue recursion. 0N/A // At this point myiw is not null so we know this test will 0N/A // never succeed if this is a pruning pass (iw == null). 0N/A // Remove me from the chain and end the recursion here. 0N/A // I am alive, but not the one to be removed, recurse 0N/A // and update my next link and leave me in the chain. 0N/A int x,
int y,
int w,
int h)
0N/A // Note tail recursion because items are added LIFO. 0N/A // My referent is null so we must prune in a second pass. 0N/A // My referent has lost interest so clear it and ask 0N/A // for a pruning pass to remove it later. 0N/A synchronized (
this) {
0N/A synchronized (
this) {
0N/A // Some Link returned true so we now need to prune dead links.