K - V - public class Storage<K,V> extends Object implements IStatsProducer<StorageStats>, Inspectable, Map<K,V>
| Modifier and Type | Field and Description |
|---|---|
static String |
DEF_CATEGORY
Default category used for producer registration.
|
static String |
DEF_SUBSYSTEM
Default subsystem used for producer registration.
|
| Constructor and Description |
|---|
Storage(StorageWrapper<K,V> aWrapper)
Creates a new anonymous storage with given wrapper.
|
Storage(String aName,
StorageWrapper<K,V> aWrapper)
Creates a new storage with given wrapper.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
static <K,V> Storage<K,V> |
createConcurrentHashMapStorage()
Factory method to create a new storage backed by a concurrent hash map.
|
static <K,V> Storage<K,V> |
createConcurrentHashMapStorage(int initialSize)
Factory method to create a new storage backed by a concurrent hash map.
|
static <K,V> Storage<K,V> |
createConcurrentHashMapStorage(String name)
Factory method to create a new storage backed by a concurrent hash map.
|
static <K,V> Storage<K,V> |
createConcurrentHashMapStorage(String name,
int initialSize)
Factory method to create a new storage backed by a concurrent hash map.
|
static <K,V> Storage<K,V> |
createHashMapStorage()
Factory method to create a new storage backed by a hashmap.
|
static <K,V> Storage<K,V> |
createHashMapStorage(int initialSize)
Factory method to create a new storage backed by a hashmap.
|
static <K,V> Storage<K,V> |
createHashMapStorage(String name)
Factory method to create a new storage backed by a hashmap.
|
static <K,V> Storage<K,V> |
createHashMapStorage(String name,
int initialSize)
Factory method to create a new storage backed by a concurrent hash map.
|
static <K,V> Storage<K,V> |
createHashtableStorage()
Factory method to create a new storage backed by a hashtable.
|
static <K,V> Storage<K,V> |
createHashtableStorage(int initialSize)
Factory method to create a new storage backed by a hashtable.
|
static <K,V> Storage<K,V> |
createHashtableStorage(String name)
Factory method to create a new storage backed by a hashtable.
|
static <K,V> Storage<K,V> |
createHashtableStorage(String name,
int initialSize)
Factory method to create a new storage backed by a hashtable.
|
static <K,V> Storage<K,V> |
createTreeMapStorage(String name)
Creates a new TreeMap backed Storage.
|
static <K,V> Storage<K,V> |
createTreeMapStorage(String name,
Comparator comparator)
Creates a new TreeMap backed Storage.
|
Set<Map.Entry<K,V>> |
entrySet() |
Map<K,V> |
fillMap(Map<K,V> toFill)
Puts all elements into a given map.
|
V |
get(Object key) |
String |
getCategory()
Returns the category of this producer.
|
CreationInfo |
getCreationInfo()
Returns the creation info of this object.
|
String |
getName()
Returns this storage's name.
|
String |
getProducerId()
Returns the meaningful id of this producer.
|
List<StorageStats> |
getStats()
Returns the list of all stats.
|
String |
getSubsystem()
Returns the subsystem the current producer is located in.
|
boolean |
isEmpty() |
Collection<K> |
keys()
Convenience method for old hashtable users.
|
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> anotherMap) |
void |
putAll(Storage<? extends K,? extends V> anotherStorage)
Puts all elements from anotherStorage to this storage.
|
V |
remove(Object key) |
void |
setCategory(String aCategory)
Sets the category of this producer.
|
void |
setSubsystem(String aSubsystem)
Sets the subsystem of this producer.
|
int |
size() |
Map<K,V> |
toMap()
Creates a map copy of this storage with all contained elements.
|
Collection<V> |
values() |
public static final String DEF_CATEGORY
public static final String DEF_SUBSYSTEM
public Storage(StorageWrapper<K,V> aWrapper)
aWrapper - public Storage(String aName, StorageWrapper<K,V> aWrapper)
aName - storage nameaWrapper - wrapper namepublic boolean containsKey(Object key)
containsKey in interface Map<K,V>public boolean containsValue(Object value)
containsValue in interface Map<K,V>public void putAll(Storage<? extends K,? extends V> anotherStorage)
anotherStorage - public Collection<K> keys()
public Map<K,V> toMap()
public Map<K,V> fillMap(Map<K,V> toFill)
toFill - map to fill to.public String getCategory()
IStatsProducergetCategory in interface IStatsProducer<StorageStats>public String getProducerId()
IStatsProducergetProducerId in interface IStatsProducer<StorageStats>public List<StorageStats> getStats()
IStatsProducergetStats in interface IStatsProducer<StorageStats>public String getSubsystem()
IStatsProducergetSubsystem in interface IStatsProducer<StorageStats>public void setSubsystem(String aSubsystem)
aSubsystem - subsystem to set.public void setCategory(String aCategory)
aCategory - category to set.public String getName()
public CreationInfo getCreationInfo()
InspectablegetCreationInfo in interface Inspectablepublic static <K,V> Storage<K,V> createHashMapStorage()
K - V - public static <K,V> Storage<K,V> createHashMapStorage(int initialSize)
K - V - initialSize - public static <K,V> Storage<K,V> createHashMapStorage(String name)
K - V - name - public static <K,V> Storage<K,V> createHashMapStorage(String name, int initialSize)
K - V - name - initialSize - public static <K,V> Storage<K,V> createConcurrentHashMapStorage()
K - V - public static <K,V> Storage<K,V> createConcurrentHashMapStorage(int initialSize)
K - V - initialSize - initial size of the storage.public static <K,V> Storage<K,V> createConcurrentHashMapStorage(String name)
K - V - name - public static <K,V> Storage<K,V> createConcurrentHashMapStorage(String name, int initialSize)
K - V - name - initialSize - public static <K,V> Storage<K,V> createHashtableStorage()
K - V - public static <K,V> Storage<K,V> createHashtableStorage(int initialSize)
K - V - initialSize - public static <K,V> Storage<K,V> createHashtableStorage(String name)
K - V - name - public static <K,V> Storage<K,V> createHashtableStorage(String name, int initialSize)
K - V - name - initialSize - public static <K,V> Storage<K,V> createTreeMapStorage(String name)
K - V - name - name of the mappublic static <K,V> Storage<K,V> createTreeMapStorage(String name, Comparator comparator)
K - V - name - namecomparator - comparatorCopyright © 2010-2017 anotheria.net. All Rights Reserved.