Package org.djutils.event.ref
Enum ReferenceType
- java.lang.Object
-
- java.lang.Enum<ReferenceType>
-
- org.djutils.event.ref.ReferenceType
-
- All Implemented Interfaces:
Serializable
,Comparable<ReferenceType>
public enum ReferenceType extends Enum<ReferenceType>
ReferenceType indicates whether a reference is strong or weak.Copyright (c) 2019-2021 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.- Author:
- Alexander Verbraeck
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isStrong()
Return whether the reference is strong.boolean
isWeak()
Return whether the reference is weak.static ReferenceType
valueOf(String name)
Returns the enum constant of this type with the specified name.static ReferenceType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
STRONG
public static final ReferenceType STRONG
Strong reference.
-
WEAK
public static final ReferenceType WEAK
Weak reference.
-
-
Method Detail
-
values
public static ReferenceType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ReferenceType c : ReferenceType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ReferenceType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
isStrong
public boolean isStrong()
Return whether the reference is strong.- Returns:
- boolean; true when reference is strong
-
isWeak
public boolean isWeak()
Return whether the reference is weak.- Returns:
- boolean; true when reference is weak
-
-