1 package org.djutils.event.reference; 2 3 import java.io.Serializable; 4 5 /** 6 * The Reference abstract class defines an indirect pointer to an object that can be serialized, in contrast with the Java 7 * Reference class, which is not serializable. References can be weak or strong. 8 * <p> 9 * Copyright (c) 2002-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See 10 * for project information <a href="https://djutils.org" target="_blank"> https://djutils.org</a>. The DJUTILS project is 11 * distributed under a three-clause BSD-style license, which can be found at 12 * <a href="https://djutils.org/docs/license.html" target="_blank"> https://djutils.org/docs/license.html</a>. This class was 13 * originally part of the DSOL project, see <a href="https://simulation.tudelft.nl/dsol/manual" target="_blank"> 14 * https://simulation.tudelft.nl/dsol/manual</a>. 15 * </p> 16 * @author <a href="https://www.linkedin.com/in/peterhmjacobs">Peter Jacobs </a> 17 * @author <a href="https://www.tudelft.nl/averbraeck">Alexander Verbraeck</a> 18 * @param <T> the type of the reference 19 */ 20 public abstract class Reference<T extends Serializable> implements Serializable 21 { 22 /** The default serial version UID for serializable classes. */ 23 private static final long serialVersionUID = 20140830L; 24 25 /** 26 * Returns this reference object's referent. If this reference object has been cleared, either by the program or by the 27 * garbage collector, then this method returns <code>null</code>. 28 * @return The object to which this reference refers, or <code>null</code> if this reference object has been cleared. 29 */ 30 public abstract T get(); 31 32 }