public static enum ReferenceUtil.ReferenceType extends Enum<ReferenceUtil.ReferenceType>
Enum Constant and Description |
---|
PHANTOM
虚引用,在GC时发现虚引用对象,会将
PhantomReference 插入ReferenceQueue 。 |
SOFT
软引用,在GC报告内存不足时会被GC回收
|
WEAK
弱引用,在GC时发现弱引用会回收其对象
|
Modifier and Type | Method and Description |
---|---|
static ReferenceUtil.ReferenceType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ReferenceUtil.ReferenceType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ReferenceUtil.ReferenceType SOFT
public static final ReferenceUtil.ReferenceType WEAK
public static final ReferenceUtil.ReferenceType PHANTOM
public static ReferenceUtil.ReferenceType[] values()
for (ReferenceUtil.ReferenceType c : ReferenceUtil.ReferenceType.values()) System.out.println(c);
public static ReferenceUtil.ReferenceType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2025. All rights reserved.