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