public class DifferentialMap<K,V>
extends java.lang.Object
implements java.util.Map<K,V>
Modifier and Type | Field and Description |
---|---|
protected java.util.function.Predicate<DifferentialMap<K,V>> |
shouldCollapse |
Constructor and Description |
---|
DifferentialMap()
Create an empty differential map.
|
DifferentialMap(java.util.Map<K,V> m)
Create a differential map from another map.
|
DifferentialMap(java.util.Map<K,V> m,
java.util.function.Predicate<DifferentialMap<K,V>> shouldCollapse)
Create a differential map from another map and a collapse criterion.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
collapse()
Changes the internal representation by applying action nodes to a copy of the root.
|
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
@NotNull java.util.Set<java.util.Map.Entry<K,V>> |
entrySet() |
boolean |
equals(java.lang.Object obj) |
V |
get(java.lang.Object key) |
int |
getDepth()
Returns the depth of the action node with regard to the root map.
|
int |
hashCode() |
boolean |
isEmpty() |
@NotNull java.util.Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(@NotNull java.util.Map<? extends K,? extends V> m) |
V |
remove(java.lang.Object key) |
int |
size() |
@NotNull java.util.Collection<V> |
values() |
protected final java.util.function.Predicate<DifferentialMap<K,V>> shouldCollapse
public DifferentialMap()
public DifferentialMap(java.util.Map<K,V> m)
m
- initial map if it is a differential map, the collapse criterion will be copied from itpublic DifferentialMap(java.util.Map<K,V> m, java.util.function.Predicate<DifferentialMap<K,V>> shouldCollapse)
m
- initial mapshouldCollapse
- whether the map should collapse into a root nodepublic void collapse()
public int getDepth()
public boolean containsKey(java.lang.Object key)
public boolean containsValue(java.lang.Object value)
@NotNull public @NotNull java.util.Set<K> keySet()
@NotNull public @NotNull java.util.Collection<V> values()
public int hashCode()