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