Package org.verapdf.core
Class MapBackedRegistry<K,V>
- java.lang.Object
-
- org.verapdf.core.MapBackedDirectory<K,V>
-
- org.verapdf.core.MapBackedRegistry<K,V>
-
- Type Parameters:
K- A key or lookup typeV- A value type
public class MapBackedRegistry<K,V> extends MapBackedDirectory<K,V> implements Registry<K,V>
- Author:
- Carl Wilson
-
-
Field Summary
-
Fields inherited from class org.verapdf.core.MapBackedDirectory
map
-
-
Constructor Summary
Constructors Constructor Description MapBackedRegistry()Creates an empty registry instance, initialised with an empty mapMapBackedRegistry(Map<K,V> map)Creates a registry instance initialise using the passed map
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VputdateItem(K key, V value){ @inheritDoc }voidputdateItems(Map<K,V> itemMap){ @inheritDoc }VregisterItem(K key, V value){ @inheritDoc }voidregisterItems(Map<K,V> itemMap){ @inheritDoc }VremoveItem(K key){ @inheritDoc }voidremoveItems(Set<K> keys){ @inheritDoc }VupdateItem(K key, V value){ @inheritDoc }voidupdateItems(Map<K,V> itemMap){ @inheritDoc }-
Methods inherited from class org.verapdf.core.MapBackedDirectory
equals, getItem, getItems, getKeys, hashCode, isEmpty, size
-
-
-
-
Method Detail
-
registerItem
public V registerItem(K key, V value)
{ @inheritDoc }- Specified by:
registerItemin interfaceRegistry<K,V>- Parameters:
key- the lookup key for the value to addvalue- the value to add- Returns:
- the added value
-
registerItems
public void registerItems(Map<K,V> itemMap)
{ @inheritDoc }- Specified by:
registerItemsin interfaceRegistry<K,V>
-
removeItem
public V removeItem(K key)
{ @inheritDoc }- Specified by:
removeItemin interfaceRegistry<K,V>- Parameters:
key- the lookup key for the value to unregister.- Returns:
- the removed value or null if no value was associated with the key
-
removeItems
public void removeItems(Set<K> keys)
{ @inheritDoc }- Specified by:
removeItemsin interfaceRegistry<K,V>- Parameters:
keys- the Set of lookup keys to remove.
-
putdateItem
public V putdateItem(K key, V value)
{ @inheritDoc }- Specified by:
putdateItemin interfaceRegistry<K,V>- Parameters:
key- the lookup key of the value to putdate.value- the value to be used for the putdate.- Returns:
- the old value of the item
-
putdateItems
public void putdateItems(Map<K,V> itemMap)
{ @inheritDoc }- Specified by:
putdateItemsin interfaceRegistry<K,V>- Parameters:
itemMap- a Map of keys & values to add.
-
updateItem
public V updateItem(K key, V value)
{ @inheritDoc }- Specified by:
updateItemin interfaceRegistry<K,V>- Parameters:
key- the lookup key of the value to updatevalue- the value used in the update- Returns:
- the old value of the item
-
-