nl.tudelft.simulation.event.ref
Class WeakReference

java.lang.Object
  extended by nl.tudelft.simulation.event.ref.Reference
      extended by nl.tudelft.simulation.event.ref.WeakReference
All Implemented Interfaces:
Serializable

public class WeakReference
extends Reference

A WeakReference. The weakreference extends the java.lang.ref.WeakReference and besides implementing the Reference interface no changes are defined.

(c) copyright 2002-2005 Delft University of Technology , the Netherlands.

See for project information www.simulation.tudelft.nl/event
License of use: Lesser General Public License (LGPL) , no warranty

Since:
1.2
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:24:36 $
Author:
Peter Jacobs
See Also:
Serialized Form

Constructor Summary
WeakReference(Object referent)
          Creates a new weak reference that refers to the given object.
 
Method Summary
 Object get()
          Returns this reference object's referent.
protected  void set(Object value)
          sets the value of the reference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeakReference

public WeakReference(Object referent)
Creates a new weak reference that refers to the given object. The new reference is not registered with any queue.

Parameters:
referent - object the new weak reference will refer to
Method Detail

get

public Object get()
Description copied from class: Reference
Returns this reference object's referent. If this reference object has been cleared, either by the program or by the garbage collector, then this method returns null.

Specified by:
get in class Reference
Returns:
The object to which this reference refers, or null if this reference object has been cleared
See Also:
Reference.get()

set

protected void set(Object value)
Description copied from class: Reference
sets the value of the reference

Specified by:
set in class Reference
See Also:
Reference.set(java.lang.Object)


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.