public abstract class XRegistry<T>
extends java.lang.Object
| Constructor and Description |
|---|
XRegistry()
Instantiates a new registry.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
areEqual(T a,
T b)
Subclasses must implement this method.
|
T |
currentDefault()
Retrieves the current default instance.
|
java.util.Set<T> |
getAvailable()
Retrieves a set of all available instances.
|
protected boolean |
isContained(T instance)
Checks whether the given instance is already
contained in the registry.
|
void |
register(T instance)
Registers a new instance with this registry.
|
void |
setCurrentDefault(T instance)
Sets the current default instance of
this registry.
|
public java.util.Set<T> getAvailable()
public T currentDefault()
public void register(T instance)
instance - Instance to be registered.public void setCurrentDefault(T instance)
instance - Instance to be the
current default of this registry.protected abstract boolean areEqual(T a, T b)
a - An instance a.b - Another instance b.protected boolean isContained(T instance)
instance - Instance to check against registry.