Package org.apache.bookkeeper.util
Class SnapshotMap<K,V>
- java.lang.Object
-
- org.apache.bookkeeper.util.SnapshotMap<K,V>
-
public class SnapshotMap<K,V> extends java.lang.Object
A snapshotable map.
-
-
Constructor Summary
Constructors Constructor Description SnapshotMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(K key)
Returns true if this map contains a mapping for the specified key.void
put(K key, V value)
Associates the specified value with the specified key in this map.void
remove(K key)
Removes the mapping for the key from this map if it is present.java.util.NavigableMap<K,V>
snapshot()
Create a snapshot of current map.
-
-
-
Method Detail
-
snapshot
public java.util.NavigableMap<K,V> snapshot()
Create a snapshot of current map.- Returns:
- a snapshot of current map.
-
put
public void put(K key, V value)
Associates the specified value with the specified key in this map.- Parameters:
key
- Key with which the specified value is to be associated.value
- Value to be associated with the specified key.
-
remove
public void remove(K key)
Removes the mapping for the key from this map if it is present.- Parameters:
key
- Key whose mapping is to be removed from this map.
-
containsKey
public boolean containsKey(K key)
Returns true if this map contains a mapping for the specified key.- Parameters:
key
- Key whose presence is in the map to be tested.- Returns:
- true if the map contains a mapping for the specified key.
-
-