Package org.djutils.event.ref
Class Reference<T extends Serializable>
java.lang.Object
org.djutils.event.ref.Reference<T>
- Type Parameters:
T
- the type of the reference
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
StrongReference
,WeakReference
public abstract class Reference<T extends Serializable> extends Object implements Serializable
The Reference abstract class defines an indirect pointer to an object that can be serialized, in contrast with the Java
Reference class, which is not serializable. References can be weak or strong.
Copyright (c) 2002-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html. This class was originally part of the DSOL project, see https://simulation.tudelft.nl/dsol/manual.
- Author:
- Peter Jacobs , Alexander Verbraeck
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description Reference()
-
Method Summary
-
Constructor Details
-
Reference
public Reference()
-
-
Method Details
-
get
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 returnsnull
.- Returns:
- The object to which this reference refers, or
null
if this reference object has been cleared.
-