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 V
putdateItem(K key, V value)
{ @inheritDoc }void
putdateItems(Map<K,V> itemMap)
{ @inheritDoc }V
registerItem(K key, V value)
{ @inheritDoc }void
registerItems(Map<K,V> itemMap)
{ @inheritDoc }V
removeItem(K key)
{ @inheritDoc }void
removeItems(Set<K> keys)
{ @inheritDoc }V
updateItem(K key, V value)
{ @inheritDoc }void
updateItems(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:
registerItem
in 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:
registerItems
in interfaceRegistry<K,V>
-
removeItem
public V removeItem(K key)
{ @inheritDoc }- Specified by:
removeItem
in 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:
removeItems
in interfaceRegistry<K,V>
- Parameters:
keys
- the Set of lookup keys to remove.
-
putdateItem
public V putdateItem(K key, V value)
{ @inheritDoc }- Specified by:
putdateItem
in 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:
putdateItems
in interfaceRegistry<K,V>
- Parameters:
itemMap
- a Map of keys & values to add.
-
updateItem
public V updateItem(K key, V value)
{ @inheritDoc }- Specified by:
updateItem
in 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
-
-