T - Type of the target of all the references in the set.public class WeakReferenceSet<T extends WeakReferenceTarget> extends Object
Represents a set of weak references and provides a means to resolve them at runtime. The class provides a consistent set of delegate add, contains and remove methods for weak reference set type properties.
| Constructor and Description |
|---|
WeakReferenceSet() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T item) |
void |
add(WeakReference<T> reference) |
void |
clear() |
boolean |
contains(T item) |
int |
count() |
Set<T> |
getOptionalSet() |
Set<T> |
getRequiredSet() |
boolean |
remove(T item) |
public void add(T item) throws NullPointerException
NullPointerExceptionpublic void add(WeakReference<T> reference) throws NullPointerException
NullPointerExceptionpublic boolean contains(T item) throws NullPointerException
NullPointerExceptionpublic boolean remove(T item) throws NullPointerException
NullPointerExceptionpublic void clear()
public int count()
public Set<T> getOptionalSet() throws PropertyNotPresentException
PropertyNotPresentException(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.