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
,Serializable
- Enclosing class:
PersistentTrieSetMultimap<K,
V>
private static final class PersistentTrieSetMultimap.HashCollisionNode<K,V>
extends PersistentTrieSetMultimap.AbstractHashCollisionNode<K,V>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<Map.Entry<K, Set.Immutable<V>>> private final int
private static final RuntimeException
private static final Supplier
<RuntimeException> 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
ConstructorsConstructorDescriptionHashCollisionNode
(int hash, List<Map.Entry<K, Set.Immutable<V>>> collisionContent) HashCollisionNode
(int hash, K key0, Set.Immutable<V> valColl0, K key1, Set.Immutable<V> valColl1) -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(K key, int keyHash, int shift, EqualityComparator<Object> cmp) boolean
containsTuple
(K key, V value, int keyHash, int shift, EqualityComparator<Object> cmp) boolean
final Optional
<Set.Immutable<V>> findByKey
(K key, int keyHash, int shift, EqualityComparator<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) Object
getSlot
(int index) (package private) boolean
hasNodes()
(package private) boolean
(package private) boolean
hasSlots()
insertedMultiple
(AtomicReference<Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<Object> cmp) insertedSingle
(AtomicReference<Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<Object> cmp) (package private) int
(package private) int
removed
(AtomicReference<Thread> mutator, K key, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<Object> cmp) Removes all values associated withkey
.removed
(AtomicReference<Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<Object> cmp) Removes thekey
/val
tuple.byte
Abstract predicate over a node's size.(package private) int
updatedMultiple
(AtomicReference<Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<Object> cmp) updatedSingle
(AtomicReference<Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<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 Details
-
hash
private final int hash -
collisionContent
-
UOE
-
UOE_NOT_YET_IMPLEMENTED_FACTORY
-
-
Constructor Details
-
HashCollisionNode
HashCollisionNode(int hash, K key0, Set.Immutable<V> valColl0, K key1, Set.Immutable<V> valColl1) -
HashCollisionNode
HashCollisionNode(int hash, List<Map.Entry<K, Set.Immutable<V>>> collisionContent)
-
-
Method Details
-
nodeArray
-
equals
-
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
- Specified by:
getNode
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,
V>
-
hasPayload
- Specified by:
hasPayload
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,
V>
-
payloadArity
- Specified by:
payloadArity
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,
V>
-
getSingletonKey
- Specified by:
getSingletonKey
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,
V>
-
getSingletonValue
- Specified by:
getSingletonValue
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,
V>
-
getCollectionKey
- Specified by:
getCollectionKey
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,
V>
-
getCollectionValue
- 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
- Specified by:
getSlot
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,
V>
-
containsKey
- 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<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 Optional<Set.Immutable<V>> findByKey(K key, int keyHash, int shift, EqualityComparator<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(AtomicReference<Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<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(AtomicReference<Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<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(AtomicReference<Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<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(AtomicReference<Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<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(AtomicReference<Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<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(AtomicReference<Thread> mutator, K key, int keyHash, int shift, MultimapResult<K, V, Set.Immutable<V>> details, EqualityComparator<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>
-