public class SimpleCachingRegistry<K,V> extends java.lang.Object implements Registry<K,V>
CachingRegistry can't be used
due to its reliance on the gs-collections library. Not designed for high throughput but for use on things like
handheld devices, where the synchronized nature of the registry won't affect performance much.| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the
Registry, resetting its state and calling Registration.cancel() for any active Registration. |
java.util.Iterator<Registration<K,? extends V>> |
iterator() |
Registration<K,V> |
register(Selector<K> sel,
V obj)
Assign the given
Selector with the given object. |
java.util.List<Registration<K,? extends V>> |
select(K key)
|
boolean |
unregister(java.lang.Object key)
Remove any objects matching this
key. |
public Registration<K,V> register(Selector<K> sel, V obj)
RegistrySelector with the given object.public boolean unregister(java.lang.Object key)
Registrykey. This will unregister all objects matching the given
key. There's no provision for removing only a specific object.unregister in interface Registry<K,V>key - The key to be matched by the Selectorspublic java.util.List<Registration<K,? extends V>> select(K key)
Registrypublic void clear()
RegistryRegistry, resetting its state and calling Registration.cancel() for any active Registration.public java.util.Iterator<Registration<K,? extends V>> iterator()
iterator in interface java.lang.Iterable<Registration<K,? extends V>>