⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 weakref.java

📁 aglet的部分源码
💻 JAVA
字号:
package com.ibm.awb.weakref;/* * @(#)WeakRef.java *  * IBM Confidential-Restricted *  * OCO Source Materials *  * 03L7246 (c) Copyright IBM Corp. 1996, 1998 *  * The source code for this program is not published or otherwise * divested of its trade secrets, irrespective of what has been * deposited with the U.S. Copyright Office. */import java.io.*;public abstract class WeakRef implements Ref {	/* package */	long _ref_count = 0;	protected WeakRefTable _table = null;	protected WeakRef(WeakRefTable table) {		_table = table;	}	/*	 * Find new reference if any	 */	abstract protected Ref findRef();	/*	 * Find a reference in a table.	 */	abstract protected Ref findRef(ObjectInputStream s) 			throws IOException, ClassNotFoundException;	/* package */	/* synchronized */	public final Ref getRef(VirtualRef vref) {		Ref found = findRef();		// this reference must be updated.		if (found != null) {			vref.setRef(found);			return found;		} 		return this;	}	/*	 * Get Reference ID	 */	abstract protected Object getRefID();	/*	 * Called when referenced	 */	/* package */	synchronized public final void referenced() {		// System.out.println("-- referenced --");		// Thread.dumpStack();		_ref_count++;	}	/*	 * Get reference and increment refernce count	 */	/* package */	public final void setRef(VirtualRef vref, ObjectInputStream s) 			throws IOException, ClassNotFoundException {		// this reference must be already updated.		Ref ref = findRef(s);		if (ref != null) {			vref.setRef(ref);		} 	}	public String toString() {		return "WeakRef[count=" + _ref_count + "]";	}	/*	 * Called when the proxy unreferenced the ref.	 */	/* package */	public /* synchronized */ final void unreferenced() {		_table.unreference(this);	}	protected boolean updateRef(VirtualRef vref) {		return vref.getRef() == this;	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -