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 intprivate static final RuntimeExceptionprivate static final Supplier<RuntimeException> Fields inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.CompactSetMultimapNode
BIT_PARTITION_MASK, BIT_PARTITION_SIZE, EMPTY_NODE, HASH_CODE_LENGTHFields inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractSetMultimapNode
TUPLE_LENGTHFields 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 TypeMethodDescriptionbooleancontainsKey(K key, int keyHash, int shift, EqualityComparator<Object> cmp) booleancontainsTuple(K key, V value, int keyHash, int shift, EqualityComparator<Object> cmp) booleanfinal Optional<Set.Immutable<V>> findByKey(K key, int keyHash, int shift, EqualityComparator<Object> cmp) (package private) KgetCollectionKey(int index) (package private) Set.Immutable<V> getCollectionValue(int index) (package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K, V> getNode(int index) (package private) KgetSingletonKey(int index) (package private) VgetSingletonValue(int index) (package private) ObjectgetSlot(int index) (package private) booleanhasNodes()(package private) boolean(package private) booleanhasSlots()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) intremoved(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/valtuple.byteAbstract predicate over a node's size.(package private) intupdatedMultiple(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, typeOfSingletonMethods 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, updatedMethods inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractSetMultimapNode
dataArray, isAllowedToEdit, mustUnbox, nodeIterator, size, unboxMethods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:
hasNodesin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
nodeArity
int nodeArity()- Specified by:
nodeArityin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getNode
- Specified by:
getNodein classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
hasPayload
- Specified by:
hasPayloadin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
payloadArity
- Specified by:
payloadArityin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getSingletonKey
- Specified by:
getSingletonKeyin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getSingletonValue
- Specified by:
getSingletonValuein classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getCollectionKey
- Specified by:
getCollectionKeyin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getCollectionValue
- Specified by:
getCollectionValuein classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
hasSlots
boolean hasSlots()- Specified by:
hasSlotsin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
slotArity
int slotArity()- Specified by:
slotArityin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getSlot
- Specified by:
getSlotin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
containsKey
- Specified by:
containsKeyin interfaceMultimapNode<K,V, Set.Immutable<V>, PersistentTrieSetMultimap.AbstractSetMultimapNode<K, V>> - Overrides:
containsKeyin classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
containsTuple
public boolean containsTuple(K key, V value, int keyHash, int shift, EqualityComparator<Object> cmp) - Specified by:
containsTuplein interfaceMultimapNode<K,V, Set.Immutable<V>, PersistentTrieSetMultimap.AbstractSetMultimapNode<K, V>> - Overrides:
containsTuplein classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
findByKey
public final Optional<Set.Immutable<V>> findByKey(K key, int keyHash, int shift, EqualityComparator<Object> cmp) - Specified by:
findByKeyin interfaceMultimapNode<K,V, Set.Immutable<V>, PersistentTrieSetMultimap.AbstractSetMultimapNode<K, V>> - Overrides:
findByKeyin 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:
insertedSinglein interfaceMultimapNode<K,V, Set.Immutable<V>, PersistentTrieSetMultimap.AbstractSetMultimapNode<K, V>> - Overrides:
insertedSinglein 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:
insertedMultiplein interfaceMultimapNode<K,V, Set.Immutable<V>, PersistentTrieSetMultimap.AbstractSetMultimapNode<K, V>> - Overrides:
insertedMultiplein 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:
updatedSinglein interfaceMultimapNode<K,V, Set.Immutable<V>, PersistentTrieSetMultimap.AbstractSetMultimapNode<K, V>> - Overrides:
updatedSinglein 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:
updatedMultiplein interfaceMultimapNode<K,V, Set.Immutable<V>, PersistentTrieSetMultimap.AbstractSetMultimapNode<K, V>> - Overrides:
updatedMultiplein 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:MultimapNodeRemoves thekey/valtuple.- Specified by:
removedin interfaceMultimapNode<K,V, Set.Immutable<V>, PersistentTrieSetMultimap.AbstractSetMultimapNode<K, V>> - Overrides:
removedin 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:MultimapNodeRemoves all values associated withkey.- Specified by:
removedin interfaceMultimapNode<K,V, Set.Immutable<V>, PersistentTrieSetMultimap.AbstractSetMultimapNode<K, V>> - Overrides:
removedin classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-