public abstract class SingletonMap<K,V> extends Object
Constructor and Description |
---|
SingletonMap() |
Modifier and Type | Method and Description |
---|---|
boolean |
createSingleton(K key)
Initialize a value object for this key and return true, if this is the first time this key has been seen,
otherwise return false.
|
V |
get(K key)
Get the singleton for a given key.
|
abstract V |
newInstance(K key)
Construct a new singleton instance.
|
List<V> |
values()
Get all singletons in the map.
|
public boolean createSingleton(K key) throws Exception
Exception
public abstract V newInstance(K key) throws Exception
Exception
public V get(K key) throws InterruptedException
InterruptedException
public List<V> values() throws InterruptedException
InterruptedException
Copyright © 2016. All rights reserved.