public class SimpleCachingRegistry<K,V> extends 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 . |
Iterator<Registration<K,? extends V>> |
iterator() |
Registration<K,V> |
register(Selector<K> sel,
V obj)
Assign the given
Selector with the given object. |
List<Registration<K,? extends V>> |
select(K key)
|
boolean |
unregister(Object key)
Remove any objects matching this
key . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public Registration<K,V> register(Selector<K> sel, V obj)
Registry
Selector
with the given object.public boolean unregister(Object key)
Registry
key
. 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 List<Registration<K,? extends V>> select(K key)
Registry
public void clear()
Registry
Registry
, resetting its state and calling Registration.cancel()
for any active Registration
.public Iterator<Registration<K,? extends V>> iterator()
iterator
in interface Iterable<Registration<K,? extends V>>
Copyright © 2016. All rights reserved.