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>>>collisionContentprivate inthashprivate static java.lang.RuntimeExceptionUOEprivate 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 booleancontainsKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)booleancontainsTuple(K key, V value, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)booleanequals(java.lang.Object other)java.util.Optional<Set.Immutable<V>>findByKey(K key, int keyHash, int shift, EqualityComparator<java.lang.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) java.lang.ObjectgetSlot(int index)(package private) booleanhasNodes()(package private) booleanhasPayload(EitherSingletonOrCollection.Type type)(package private) booleanhasSlots()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) intnodeArity()ArrayView<PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>nodeArray()(package private) intpayloadArity(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/valtuple.bytesizePredicate()Abstract predicate over a node's size.(package private) intslotArity()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:
equalsin classjava.lang.Object
-
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
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> getNode(int index)
- Specified by:
getNodein classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
hasPayload
boolean hasPayload(EitherSingletonOrCollection.Type type)
- Specified by:
hasPayloadin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
payloadArity
int payloadArity(EitherSingletonOrCollection.Type type)
- Specified by:
payloadArityin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getSingletonKey
K getSingletonKey(int index)
- Specified by:
getSingletonKeyin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getSingletonValue
V getSingletonValue(int index)
- Specified by:
getSingletonValuein classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getCollectionKey
K getCollectionKey(int index)
- Specified by:
getCollectionKeyin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getCollectionValue
Set.Immutable<V> getCollectionValue(int index)
- 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
java.lang.Object getSlot(int index)
- Specified by:
getSlotin classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
containsKey
public boolean containsKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
- 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<java.lang.Object> cmp)
- Specified by:
containsTuplein interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>- Overrides:
containsTuplein 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:
findByKeyin interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>- Overrides:
findByKeyin 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:
insertedSinglein interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>- Overrides:
insertedSinglein 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:
insertedMultiplein interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>- Overrides:
insertedMultiplein 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:
updatedSinglein interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>- Overrides:
updatedSinglein 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:
updatedMultiplein interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>- Overrides:
updatedMultiplein 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: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(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:MultimapNodeRemoves all values associated withkey.- Specified by:
removedin interfaceMultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>- Overrides:
removedin classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
-