Top Description Inners Methods
org.wildfly.common.ref

public Interface Reference<T, A>

Known Direct Implementers
org.wildfly.common.ref.SoftReference, org.wildfly.common.ref.StrongReference, org.wildfly.common.ref.WeakReference, org.wildfly.common.ref.PhantomReference
Type Parameters
<T>
the reference value type
<A>
the attachment type
Imports
java.util.EnumSet

An enhanced reference type with a type-safe attachment.
Author
David M. Lloyd
See Also
java.lang.ref.Reference

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Reference.Type

A reference type.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Clear the reference.

public T

Returns:

the value
get
()

Get the value, or null if the reference has been cleared.

public A

Returns:

the attachment
getAttachment
()

Get the attachment, if any.

public Reference.Type

Returns:

the type
getType
()

Get the type of the reference.

Method Detail

clearback to summary
public void clear()

Clear the reference.

getback to summary
public T get()

Get the value, or null if the reference has been cleared.

Returns:T

the value

getAttachmentback to summary
public A getAttachment()

Get the attachment, if any.

Returns:A

the attachment

getTypeback to summary
public Reference.Type getType()

Get the type of the reference.

Returns:Reference.Type

the type

org.wildfly.common.ref back to summary

public final Enum Reference.Type

extends Enum<Reference.Type>
Class Inheritance

A reference type.

Field Summary

Modifier and TypeField and Description
private static final int
public static final Reference.Type
NULL

A null reference.

public static final Reference.Type
PHANTOM

A phantom reference.

public static final Reference.Type
SOFT

A soft reference.

public static final Reference.Type
STRONG

A strong reference.

public static final Reference.Type
WEAK

A weak reference.

Constructor Summary

AccessConstructor and Description
private
Type()

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if one of the instances matches this one, false otherwise
in
(final Reference.Type
the first instance
v1
)

Determine whether this instance is equal to one of the given instances.

public boolean

Returns:

true if one of the instances matches this one, false otherwise
in
(final Reference.Type
the first instance
v1
,
final Reference.Type
the second instance
v2
)

Determine whether this instance is equal to one of the given instances.

public boolean

Returns:

true if one of the instances matches this one, false otherwise
in
(final Reference.Type
the first instance
v1
,
final Reference.Type
the second instance
v2
,
final Reference.Type
the third instance
v3
)

Determine whether this instance is equal to one of the given instances.

public boolean

Returns:

true if one of the instances matches this one, false otherwise
in
(final Reference.Type...
the possible values
values
)

Determine whether this instance is equal to one of the given instances.

public static boolean

Returns:

true if the set is full, false otherwise
isFull
(final EnumSet<Reference.Type>
the set
set
)

Determine whether the given set is fully populated (or "full"), meaning it contains all possible values.

public static Reference.Type
public static Reference.Type[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

fullSizeback to summary
private static final int fullSize
NULLback to summary
public static final Reference.Type NULL

A null reference.

PHANTOMback to summary
public static final Reference.Type PHANTOM

A phantom reference.

SOFTback to summary
public static final Reference.Type SOFT

A soft reference.

STRONGback to summary
public static final Reference.Type STRONG

A strong reference.

WEAKback to summary
public static final Reference.Type WEAK

A weak reference.

Constructor Detail

Typeback to summary
private Type()

Method Detail

inback to summary
public boolean in(final Reference.Type v1)

Determine whether this instance is equal to one of the given instances.

Parameters
v1:Reference.Type

the first instance

Returns:boolean

true if one of the instances matches this one, false otherwise

inback to summary
public boolean in(final Reference.Type v1, final Reference.Type v2)

Determine whether this instance is equal to one of the given instances.

Parameters
v1:Reference.Type

the first instance

v2:Reference.Type

the second instance

Returns:boolean

true if one of the instances matches this one, false otherwise

inback to summary
public boolean in(final Reference.Type v1, final Reference.Type v2, final Reference.Type v3)

Determine whether this instance is equal to one of the given instances.

Parameters
v1:Reference.Type

the first instance

v2:Reference.Type

the second instance

v3:Reference.Type

the third instance

Returns:boolean

true if one of the instances matches this one, false otherwise

inback to summary
public boolean in(final Reference.Type... values)

Determine whether this instance is equal to one of the given instances.

Parameters
values:Reference.Type[]

the possible values

Returns:boolean

true if one of the instances matches this one, false otherwise

isFullback to summary
public static boolean isFull(final EnumSet<Reference.Type> set)

Determine whether the given set is fully populated (or "full"), meaning it contains all possible values.

Parameters
set:EnumSet<Reference.Type>

the set

Returns:boolean

true if the set is full, false otherwise

valueOfback to summary
public static Reference.Type valueOf(String name)
valuesback to summary
public static Reference.Type[] values()