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 Map are not supported and will always throw
UnsupportedOperationException. All collections returned by methods of this interface are
also immutable.
Instances of this interface are thread-safe as long as published safely.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Deprecated.Unsupported operation.Deprecated.Unsupported operation.computeIfAbsent(K pKey, Function<? super K, ? extends V> pMappingFunction) Deprecated.Unsupported operation.computeIfPresent(K pKey, BiFunction<? super K, ? super V, ? extends V> pRemappingFunction) Deprecated.Unsupported operation.empty()Replacement for {clear()that returns an empty instance.Deprecated.Unsupported operation.Deprecated.Unsupported operation.voidDeprecated.Unsupported operation.putAndCopy(K key, V value) Replacement for {put(Object, Object)that returns a fresh instance.putIfAbsent(K pKey, V pValue) Deprecated.Unsupported operation.Deprecated.Unsupported operation.booleanDeprecated.Unsupported operation.removeAndCopy(Object key) Replacement for {remove(Object)that returns a fresh instance.Deprecated.Unsupported operation.booleanDeprecated.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 Details
-
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
Replacement for {remove(Object)that returns a fresh instance. -
empty
Replacement for {clear()that returns an empty instance. -
put
Deprecated.Unsupported operation. -
putIfAbsent
Deprecated.Unsupported operation.- Specified by:
putIfAbsentin interfaceMap<K,V extends @Nullable Object> - Throws:
UnsupportedOperationException- Always.
-
putAll
Deprecated.Unsupported operation. -
remove
Deprecated.Unsupported operation. -
remove
Deprecated.Unsupported operation. -
clear
Deprecated.Unsupported operation. -
compute
Deprecated.Unsupported operation. -
computeIfAbsent
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.Unsupported operation. -
replace
Deprecated.Unsupported operation. -
replaceAll
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.
-