Package io.usethesource.capsule.core
Class PersistentTrieMap<K,V>
java.lang.Object
io.usethesource.capsule.core.PersistentTrieMap<K,V>
- All Implemented Interfaces:
Map<K,
,V> Map.Immutable<K,
,V> MapEq<K,
,V> MapEq.Immutable<K,
,V> Serializable
,Map<K,
V>
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Iterator skeleton that uses a fixed stack in depth.protected static class
private static final class
protected static class
protected static class
private static final class
protected static class
protected static class
protected static class
(package private) static final class
private static class
Iterator that first iterates over inlined-values and then continues depth first recursively.Nested classes/interfaces inherited from interface io.usethesource.capsule.Map
Map.Immutable<K,
V>, Map.Transient<K, V> Nested classes/interfaces inherited from interface io.usethesource.capsule.MapEq
MapEq.Immutable<K,
V>, MapEq.Transient<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final int
private static final boolean
private static final PersistentTrieMap
private static final PersistentTrieMap.CompactMapNode
private final PersistentTrieMap.AbstractMapNode
<K, V> private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionPersistentTrieMap
(PersistentTrieMap.AbstractMapNode<K, V> rootNode, int cachedHashCode, int cachedSize) -
Method Summary
Modifier and TypeMethodDescription__putAllEquivalent
(Map<? extends K, ? extends V> map, EqualityComparator<Object> cmp) __putEquivalent
(K key, V val, EqualityComparator<Object> cmp) __removeEquivalent
(K key, EqualityComparator<Object> cmp) protected int[][]
protected int[]
private boolean
checkHashCodeAndSize
(int targetHash, int targetSize) void
clear()
boolean
boolean
boolean
boolean
entrySet()
boolean
boolean
equivalent
(Object other, EqualityComparator<Object> cmp) getEquivalent
(Object o, EqualityComparator<Object> cmp) protected int
protected PersistentTrieMap.AbstractMapNode
<K, V> int
hashCode()
boolean
isEmpty()
boolean
keySet()
protected Iterator
<PersistentTrieMap.AbstractMapNode<K, V>> static final <K,
V> Map.Immutable <K, V> of()
static final <K,
V> Map.Immutable <K, V> void
void
int
size()
toString()
static final int
transformHashCode
(int hash) static final <K,
V> Map.Transient <K, V> static final <K,
V> Map.Transient <K, V> transientOf
(Object... keyValuePairs) values()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
EMPTY_NODE
-
EMPTY_MAP
-
DEBUG
private static final boolean DEBUG- See Also:
-
rootNode
-
cachedHashCode
private final int cachedHashCode -
cachedSize
private final int cachedSize
-
-
Constructor Details
-
PersistentTrieMap
PersistentTrieMap(PersistentTrieMap.AbstractMapNode<K, V> rootNode, int cachedHashCode, int cachedSize)
-
-
Method Details
-
of
-
of
-
transientOf
-
transientOf
-
checkHashCodeAndSize
private boolean checkHashCodeAndSize(int targetHash, int targetSize) -
transformHashCode
public static final int transformHashCode(int hash) -
containsKey
- Specified by:
containsKey
in interfaceMap<K,
V> - Specified by:
containsKey
in interfaceMap<K,
V>
-
containsKeyEquivalent
- Specified by:
containsKeyEquivalent
in interfaceMapEq<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceMap<K,
V> - Specified by:
containsValue
in interfaceMap<K,
V>
-
containsValueEquivalent
- Specified by:
containsValueEquivalent
in interfaceMapEq<K,
V>
-
get
-
getEquivalent
- Specified by:
getEquivalent
in interfaceMapEq<K,
V>
-
__put
- Specified by:
__put
in interfaceMap.Immutable<K,
V>
-
__putEquivalent
- Specified by:
__putEquivalent
in interfaceMapEq.Immutable<K,
V>
-
__putAll
- Specified by:
__putAll
in interfaceMap.Immutable<K,
V>
-
__putAllEquivalent
public Map.Immutable<K,V> __putAllEquivalent(Map<? extends K, ? extends V> map, EqualityComparator<Object> cmp) - Specified by:
__putAllEquivalent
in interfaceMapEq.Immutable<K,
V>
-
__remove
- Specified by:
__remove
in interfaceMap.Immutable<K,
V>
-
__removeEquivalent
- Specified by:
__removeEquivalent
in interfaceMapEq.Immutable<K,
V>
-
put
-
putAll
-
clear
public void clear() -
remove
-
size
public int size() -
isEmpty
public boolean isEmpty() -
keyIterator
- Specified by:
keyIterator
in interfaceMap<K,
V>
-
valueIterator
- Specified by:
valueIterator
in interfaceMap<K,
V>
-
entryIterator
- Specified by:
entryIterator
in interfaceMap<K,
V>
-
keySet
-
values
-
entrySet
-
equals
-
equivalent
- Specified by:
equivalent
in interfaceMapEq<K,
V>
-
hashCode
public int hashCode() -
toString
-
isTransientSupported
public boolean isTransientSupported()- Specified by:
isTransientSupported
in interfaceMap.Immutable<K,
V>
-
asTransient
- Specified by:
asTransient
in interfaceMap.Immutable<K,
V>
-
getRootNode
-
nodeIterator
-
getNodeCount
protected int getNodeCount() -
arityCombinationsHistogram
protected int[][] arityCombinationsHistogram() -
arityHistogram
protected int[] arityHistogram() -
printStatistics
public void printStatistics()
-