【Java开源代码栏目提醒】:网学会员,鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“WeakCleanupReference.java”一文,供大家参考学习!
/* -*- mode: Java; fill-column: 72 -*-
* The contents of this file are subject to the ClickBlocks Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.clickblocks.org
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied, including, but not limited to, the implied warranties of
* merchantability, fitness for a particular purpose and
* non-infringement. See the License for the specific language
* governing rights and limitations under the License.
*
* ClickBlocks, the ClickBlocks logo and combinations thereof are
* trademarks of ClickBlocks, LLC in the United States and other
* countries.
*
* The Initial Developer of the Original Code is ClickBlocks, LLC.
* Portions created by ClickBlocks, LLC are Copyright (C) 2000.
* All Rights Reserved.
*/
/*
* $Log: WeakCleanupReference.java,v $
* Revision 1.2 2000/11/25 09:56:47 mgrand
* Made this class package private.
*
* Revision 1.1 2000/11/25 09:49:42 mgrand
* Initial Version
*
*/
// - - - - - - - - - - - - - -
package org.clickblocks.dataStructure;
// - - - - - - - - - - - - - -
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
/**
* This subclass of <code>WeakReference</code> encapsulates a reference
* to a <code>CleanupIF</code> object. Its instances are created by a
* <code>CleanupQueue</code> object.
*
* @see java.lang.ref.WeakReference
* @see CleanupIF
* @see CleanupQueue
* @author Mark Grand
* @version 0.820
*/
class WeakCleanupReference extends WeakReference {
/**
* The <code>CleanupIF</code> object.
*/
private CleanupIF myCleanup;
/**
* constructor
* @param obj
* A object to be weakly referred to by this object.
* @param queue
* The <code>CleanupQueue</code> the reference should be
* enqueue to.
* @param cleanup
* The <code>CleanupIF</code> object encapsulated by this
* object.
*/
WeakCleanupReference(Object obj,
ReferenceQueue queue,
CleanupIF cleanup) {
super(obj, queue);
myCleanup = cleanup;
} // constructor(WeakReference)
/**
* Ask the <code>CleanupIF</code> object associated with this object
* to remove itself from whatever data structure it is part of.
*/
void extricate() {
myCleanup.extricate();
} // extricate()
} // class WeakCleanupReference
上一篇:
WBUser.java
下一篇:
关于大学英语教学