Package io.usethesource.capsule.core
Class PersistentTrieSetMultimap.HashCollisionNode<K,V>
- java.lang.Object
-
- io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
- io.usethesource.capsule.core.PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
- io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractHashCollisionNode<K,V>
-
- io.usethesource.capsule.core.PersistentTrieSetMultimap.HashCollisionNode<K,V>
-
- All Implemented Interfaces:
MultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
,Node
,java.io.Serializable
- Enclosing class:
- PersistentTrieSetMultimap<K,V>
private static final class PersistentTrieSetMultimap.HashCollisionNode<K,V> extends PersistentTrieSetMultimap.AbstractHashCollisionNode<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.util.Map.Entry<K,Set.Immutable<V>>>
collisionContent
private int
hash
private static java.lang.RuntimeException
UOE
private static java.util.function.Supplier<java.lang.RuntimeException>
UOE_NOT_YET_IMPLEMENTED_FACTORY
-
Fields inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.CompactSetMultimapNode
BIT_PARTITION_MASK, BIT_PARTITION_SIZE, EMPTY_NODE, HASH_CODE_LENGTH
-
Fields inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractSetMultimapNode
TUPLE_LENGTH
-
Fields inherited from interface io.usethesource.capsule.core.trie.Node
SIZE_EMPTY, SIZE_MORE_THAN_ONE, SIZE_ONE
-
-
Constructor Summary
Constructors Constructor Description HashCollisionNode(int hash, java.util.List<java.util.Map.Entry<K,Set.Immutable<V>>> collisionContent)
HashCollisionNode(int hash, K key0, Set.Immutable<V> valColl0, K key1, Set.Immutable<V> valColl1)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
boolean
containsTuple(K key, V value, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
boolean
equals(java.lang.Object other)
java.util.Optional<Set.Immutable<V>>
findByKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
(package private) K
getCollectionKey(int index)
(package private) Set.Immutable<V>
getCollectionValue(int index)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
getNode(int index)
(package private) K
getSingletonKey(int index)
(package private) V
getSingletonValue(int index)
(package private) java.lang.Object
getSlot(int index)
(package private) boolean
hasNodes()
(package private) boolean
hasPayload(EitherSingletonOrCollection.Type type)
(package private) boolean
hasSlots()
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
insertedMultiple(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
insertedSingle(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
(package private) int
nodeArity()
ArrayView<PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
nodeArray()
(package private) int
payloadArity(EitherSingletonOrCollection.Type type)
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
removed(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
Removes all values associated withkey
.PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
removed(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
Removes thekey
/val
tuple.byte
sizePredicate()
Abstract predicate over a node's size.(package private) int
slotArity()
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
updatedMultiple(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
updatedSingle(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
-
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractHashCollisionNode
bitmap, canonicalize, collMap, copyAndInsertCollection, copyAndInsertSingleton, copyAndMigrateFromCollectionToNode, copyAndMigrateFromCollectionToSingleton, copyAndMigrateFromNodeToCollection, copyAndMigrateFromNodeToSingleton, copyAndMigrateFromSingletonToCollection, copyAndMigrateFromSingletonToNode, copyAndRemoveCollection, copyAndRemoveSingleton, copyAndSetCollectionValue, copyAndSetNode, copyAndSetSingletonValue, copyAndUpdateBitmaps, dataMap, nodeMap, of, rawMap1, rawMap2, typeOfSingleton
-
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.CompactSetMultimapNode
arity, arity, bitpos, collIndex, dataIndex, index, index, mask, mergeCollectionAndSingletonPairs, mergeTwoCollectionPairs, mergeTwoSingletonPairs, nodeIndex, nodeInvariant, nodeOf, nodeOf, nodeOf, recoverMask, toString, updated
-
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractSetMultimapNode
dataArray, isAllowedToEdit, mustUnbox, nodeIterator, size, unbox
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.usethesource.capsule.core.trie.MultimapNode
copyAndUpdateBitmaps, inserted, patternOfSingleton
-
-
-
-
Field Detail
-
hash
private final int hash
-
collisionContent
private final java.util.List<java.util.Map.Entry<K,Set.Immutable<V>>> collisionContent
-
UOE
private static final java.lang.RuntimeException UOE
-
UOE_NOT_YET_IMPLEMENTED_FACTORY
private static final java.util.function.Supplier<java.lang.RuntimeException> UOE_NOT_YET_IMPLEMENTED_FACTORY
-
-
Constructor Detail
-
HashCollisionNode
HashCollisionNode(int hash, K key0, Set.Immutable<V> valColl0, K key1, Set.Immutable<V> valColl1)
-
HashCollisionNode
HashCollisionNode(int hash, java.util.List<java.util.Map.Entry<K,Set.Immutable<V>>> collisionContent)
-
-
Method Detail
-
nodeArray
public ArrayView<PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>> nodeArray()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
sizePredicate
public byte sizePredicate()
Description copied from interface:Node
- Returns:
- size predicate
-
hasNodes
boolean hasNodes()
- Specified by:
hasNodes
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
nodeArity
int nodeArity()
- Specified by:
nodeArity
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getNode
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> getNode(int index)
- Specified by:
getNode
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
hasPayload
boolean hasPayload(EitherSingletonOrCollection.Type type)
- Specified by:
hasPayload
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
payloadArity
int payloadArity(EitherSingletonOrCollection.Type type)
- Specified by:
payloadArity
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getSingletonKey
K getSingletonKey(int index)
- Specified by:
getSingletonKey
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getSingletonValue
V getSingletonValue(int index)
- Specified by:
getSingletonValue
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getCollectionKey
K getCollectionKey(int index)
- Specified by:
getCollectionKey
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getCollectionValue
Set.Immutable<V> getCollectionValue(int index)
- Specified by:
getCollectionValue
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
hasSlots
boolean hasSlots()
- Specified by:
hasSlots
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
slotArity
int slotArity()
- Specified by:
slotArity
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getSlot
java.lang.Object getSlot(int index)
- Specified by:
getSlot
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
containsKey
public boolean containsKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
- Specified by:
containsKey
in interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
- Overrides:
containsKey
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
containsTuple
public boolean containsTuple(K key, V value, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
- Specified by:
containsTuple
in interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
- Overrides:
containsTuple
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
findByKey
public final java.util.Optional<Set.Immutable<V>> findByKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
- Specified by:
findByKey
in interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
- Overrides:
findByKey
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
insertedSingle
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> insertedSingle(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
- Specified by:
insertedSingle
in interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
- Overrides:
insertedSingle
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
insertedMultiple
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> insertedMultiple(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
- Specified by:
insertedMultiple
in interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
- Overrides:
insertedMultiple
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
updatedSingle
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> updatedSingle(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
- Specified by:
updatedSingle
in interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
- Overrides:
updatedSingle
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
updatedMultiple
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> updatedMultiple(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
- Specified by:
updatedMultiple
in interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
- Overrides:
updatedMultiple
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
removed
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> removed(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
Description copied from interface:MultimapNode
Removes thekey
/val
tuple.- Specified by:
removed
in interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
- Overrides:
removed
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
removed
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> removed(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
Description copied from interface:MultimapNode
Removes all values associated withkey
.- Specified by:
removed
in interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
- Overrides:
removed
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
-