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
- Author:
- Carl Wilson
-
Field Summary
Fields inherited from class org.verapdf.core.MapBackedDirectory
map -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty registry instance, initialised with an empty mapMapBackedRegistry(Map<K, V> map) Creates a registry instance initialise using the passed map -
Method Summary
Modifier and TypeMethodDescriptionputdateItem(K key, V value) { @inheritDoc }voidputdateItems(Map<K, V> itemMap) { @inheritDoc }registerItem(K key, V value) { @inheritDoc }voidregisterItems(Map<K, V> itemMap) { @inheritDoc }removeItem(K key) { @inheritDoc }voidremoveItems(Set<K> keys) { @inheritDoc }updateItem(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
-
Constructor Details
-
MapBackedRegistry
public MapBackedRegistry()Creates an empty registry instance, initialised with an empty map -
MapBackedRegistry
Creates a registry instance initialise using the passed map- Parameters:
map- aMap<K, V> instance used to initialise the registry.
-
-
Method Details
-
registerItem
{ @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
{ @inheritDoc }- Specified by:
registerItemsin interfaceRegistry<K,V>
-
removeItem
{ @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
{ @inheritDoc }- Specified by:
removeItemsin interfaceRegistry<K,V> - Parameters:
keys- the Set of lookup keys to remove.
-
putdateItem
{ @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
{ @inheritDoc }- Specified by:
putdateItemsin interfaceRegistry<K,V> - Parameters:
itemMap- a Map of keys & values to add.
-
updateItem
{ @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
-
updateItems
{ @inheritDoc }- Specified by:
updateItemsin interfaceRegistry<K,V>
-