View Javadoc
1   package org.djutils.event.ref;
2   
3   /**
4    * ReferenceType indicates whether a reference is strong or weak.
5    * <p>
6    * Copyright (c) 2019-2021 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
7    * BSD-style license. See <a href="https://djutils.org/docs/current/djutils/licenses.html">DJUTILS License</a>.
8    * <p>
9    * @author <a href="https://www.tudelft.nl/averbraeck" target="_blank">Alexander Verbraeck</a>
10   */
11  public enum ReferenceType
12  {
13      /** Strong reference. */
14      STRONG,
15  
16      /** Weak reference. */
17      WEAK;
18  
19      /**
20       * Return whether the reference is strong.
21       * @return boolean; true when reference is strong
22       */
23      public boolean isStrong()
24      {
25          return this.equals(STRONG);
26      }
27  
28      /**
29       * Return whether the reference is weak.
30       * @return boolean; true when reference is weak
31       */
32      public boolean isWeak()
33      {
34          return this.equals(WEAK);
35      }
36  }