Package org.sosy_lab.common.collect
Interface PersistentMap<K,V extends @Nullable Object>
-
- Type Parameters:
K- The type of keys.V- The type of values.
- All Superinterfaces:
Map<K,V>
- All Known Subinterfaces:
PersistentSortedMap<K,V>,org.sosy_lab.common.collect.PersistentSortedMapBridge<K,V>
- All Known Implementing Classes:
PathCopyingPersistentTreeMap
@Immutable(containerOf={"K","V"}) public interface PersistentMap<K,V extends @Nullable Object> extends Map<K,V>Interface for persistent map. A persistent data structure is immutable, but provides cheap copy-and-write operations. Thus all write operations ({putAndCopy(Object, Object), {removeAndCopy(Object)}) will not modify the current instance, but return a new instance instead.All modifying operations inherited from
Mapare not supported and will always throwUnsupportedOperationException. All collections returned by methods of this interface are also immutable.Instances of this interface are thread-safe as long as published safely.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidclear()Deprecated.Unsupported operation.Vcompute(K pKey, BiFunction<? super K,? super V,? extends V> pRemappingFunction)Deprecated.Unsupported operation.VcomputeIfAbsent(K pKey, Function<? super K,? extends V> pMappingFunction)Deprecated.Unsupported operation.VcomputeIfPresent(K pKey, BiFunction<? super K,? super V,? extends V> pRemappingFunction)Deprecated.Unsupported operation.PersistentMap<K,V>empty()Replacement for {clear()that returns an empty instance.Vmerge(K pKey, V pValue, BiFunction<? super V,? super V,? extends V> pRemappingFunction)Deprecated.Unsupported operation.Vput(K pKey, V pValue)Deprecated.Unsupported operation.voidputAll(Map<? extends K,? extends V> pM)Deprecated.Unsupported operation.PersistentMap<K,V>putAndCopy(K key, V value)Replacement for {put(Object, Object)that returns a fresh instance.VputIfAbsent(K pKey, V pValue)Deprecated.Unsupported operation.Vremove(Object pKey)Deprecated.Unsupported operation.booleanremove(Object pKey, Object pValue)Deprecated.Unsupported operation.PersistentMap<K,V>removeAndCopy(Object key)Replacement for {remove(Object)that returns a fresh instance.Vreplace(K pKey, V pValue)Deprecated.Unsupported operation.booleanreplace(K pKey, V pOldValue, V pNewValue)Deprecated.Unsupported operation.voidreplaceAll(BiFunction<? super K,? super V,? extends V> pFunction)Deprecated.Unsupported operation.-
Methods inherited from interface java.util.Map
containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, size, values
-
-
-
-
Method Detail
-
putAndCopy
@CheckReturnValue PersistentMap<K,V> putAndCopy(@CompatibleWith("K") K key, @CompatibleWith("V") V value)
Replacement for {put(Object, Object)that returns a fresh instance.
-
removeAndCopy
@CheckReturnValue PersistentMap<K,V> removeAndCopy(@CompatibleWith("K") Object key)
Replacement for {remove(Object)that returns a fresh instance.
-
empty
@CheckReturnValue PersistentMap<K,V> empty()
Replacement for {clear()that returns an empty instance.
-
put
@Deprecated V put(K pKey, V pValue)
Deprecated.Unsupported operation.
-
putIfAbsent
@Deprecated V putIfAbsent(K pKey, V pValue)
Deprecated.Unsupported operation.- Specified by:
putIfAbsentin interfaceMap<K,V extends @Nullable Object>- Throws:
UnsupportedOperationException- Always.
-
putAll
@Deprecated void putAll(Map<? extends K,? extends V> pM)
Deprecated.Unsupported operation.
-
remove
@Deprecated V remove(Object pKey)
Deprecated.Unsupported operation.
-
remove
@Deprecated boolean remove(Object pKey, Object pValue)
Deprecated.Unsupported operation.
-
clear
@Deprecated void clear()
Deprecated.Unsupported operation.
-
compute
@Deprecated V compute(K pKey, BiFunction<? super K,? super V,? extends V> pRemappingFunction)
Deprecated.Unsupported operation.
-
computeIfAbsent
@Deprecated V computeIfAbsent(K pKey, Function<? super K,? extends V> pMappingFunction)
Deprecated.Unsupported operation.- Specified by:
computeIfAbsentin interfaceMap<K,V extends @Nullable Object>- Throws:
UnsupportedOperationException- Always.
-
computeIfPresent
@Deprecated V computeIfPresent(K pKey, BiFunction<? super K,? super V,? extends V> pRemappingFunction)
Deprecated.Unsupported operation.- Specified by:
computeIfPresentin interfaceMap<K,V extends @Nullable Object>- Throws:
UnsupportedOperationException- Always.
-
replace
@Deprecated V replace(K pKey, V pValue)
Deprecated.Unsupported operation.
-
replace
@Deprecated boolean replace(K pKey, V pOldValue, V pNewValue)
Deprecated.Unsupported operation.
-
replaceAll
@Deprecated void replaceAll(BiFunction<? super K,? super V,? extends V> pFunction)
Deprecated.Unsupported operation.- Specified by:
replaceAllin interfaceMap<K,V extends @Nullable Object>- Throws:
UnsupportedOperationException- Always.
-
merge
@Deprecated V merge(K pKey, V pValue, BiFunction<? super V,? super V,? extends V> pRemappingFunction)
Deprecated.Unsupported operation.
-
-