Package io.usethesource.capsule.core
Class PersistentTrieSet.HashCollisionSetNode<K>
- java.lang.Object
-
- io.usethesource.capsule.core.PersistentTrieSet.AbstractSetNode<K>
-
- io.usethesource.capsule.core.PersistentTrieSet.CompactSetNode<K>
-
- io.usethesource.capsule.core.PersistentTrieSet.HashCollisionSetNode<K>
-
- All Implemented Interfaces:
Node,SetNode<K,PersistentTrieSet.AbstractSetNode<K>>,java.io.Serializable,java.lang.Iterable<K>
- Enclosing class:
- PersistentTrieSet<K>
private static final class PersistentTrieSet.HashCollisionSetNode<K> extends PersistentTrieSet.CompactSetNode<K>
-
-
Field Summary
Fields Modifier and Type Field Description private inthashprivate K[]keys-
Fields inherited from class io.usethesource.capsule.core.PersistentTrieSet.CompactSetNode
BIT_PARTITION_MASK, BIT_PARTITION_SIZE, HASH_CODE_LENGTH
-
Fields inherited from class io.usethesource.capsule.core.PersistentTrieSet.AbstractSetNode
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 HashCollisionSetNode(int hash, K[] keys)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intarity()The arity of this trie node (i.e.booleancontains(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)(package private) PersistentTrieSet.CompactSetNode<K>copyAndInsertValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key)(package private) PersistentTrieSet.CompactSetNode<K>copyAndMigrateFromInlineToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)(package private) PersistentTrieSet.CompactSetNode<K>copyAndMigrateFromNodeToInline(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)(package private) PersistentTrieSet.CompactSetNode<K>copyAndRemoveValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)(package private) PersistentTrieSet.CompactSetNode<K>copyAndSetNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)(package private) intdataMap()booleanequals(java.lang.Object other)booleanequivalent(java.lang.Object other, EqualityComparator<java.lang.Object> cmp)java.util.Optional<K>findByKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)KgetKey(int index)intgetKeyHash(int index)PersistentTrieSet.CompactSetNode<K>getNode(int index)(package private) java.lang.ObjectgetSlot(int index)inthashCode()(package private) booleanhasNodes()booleanhasPayload()(package private) booleanhasSlots()(package private) intlocalPayloadHashCode()(package private) intnodeArity()ArrayView<PersistentTrieSet.AbstractSetNode<K>>nodeArray()(package private) intnodeMap()intpayloadArity()PersistentTrieSet.AbstractSetNode<K>removed(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, int keyHash, int shift, SetNodeResult<K> details, EqualityComparator<java.lang.Object> cmp)bytesizePredicate()Abstract predicate over a node's size.(package private) intslotArity()PersistentTrieSet.AbstractSetNode<K>updated(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, int keyHash, int shift, SetNodeResult<K> details, EqualityComparator<java.lang.Object> cmp)-
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSet.CompactSetNode
bitpos, dataIndex, index, index, mask, mergeTwoKeyValPairs, nodeAt, nodeIndex, nodeInvariant, nodeOf, nodeOf, nodeOf, nodeOf, nodeOf, recoverMask, toString
-
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSet.AbstractSetNode
dataArray, isAllowedToEdit, iterator, nodeIterator, recursivePayloadHashCode, size, spliterator, stream
-
-
-
-
Field Detail
-
keys
private final K[] keys
-
hash
private final int hash
-
-
Constructor Detail
-
HashCollisionSetNode
HashCollisionSetNode(int hash, K[] keys)
-
-
Method Detail
-
nodeArray
public ArrayView<PersistentTrieSet.AbstractSetNode<K>> nodeArray()
- Specified by:
nodeArrayin interfaceNode- Specified by:
nodeArrayin classPersistentTrieSet.AbstractSetNode<K>
-
contains
public boolean contains(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
- Specified by:
containsin interfaceSetNode<K,PersistentTrieSet.AbstractSetNode<K>>- Overrides:
containsin classPersistentTrieSet.CompactSetNode<K>
-
findByKey
public java.util.Optional<K> findByKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
- Specified by:
findByKeyin interfaceSetNode<K,PersistentTrieSet.AbstractSetNode<K>>- Overrides:
findByKeyin classPersistentTrieSet.CompactSetNode<K>
-
updated
public PersistentTrieSet.AbstractSetNode<K> updated(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, int keyHash, int shift, SetNodeResult<K> details, EqualityComparator<java.lang.Object> cmp)
- Specified by:
updatedin interfaceSetNode<K,PersistentTrieSet.AbstractSetNode<K>>- Overrides:
updatedin classPersistentTrieSet.CompactSetNode<K>
-
removed
public PersistentTrieSet.AbstractSetNode<K> removed(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, int keyHash, int shift, SetNodeResult<K> details, EqualityComparator<java.lang.Object> cmp)
- Specified by:
removedin interfaceSetNode<K,PersistentTrieSet.AbstractSetNode<K>>- Overrides:
removedin classPersistentTrieSet.CompactSetNode<K>
-
hasPayload
public boolean hasPayload()
-
payloadArity
public int payloadArity()
-
hasNodes
boolean hasNodes()
- Specified by:
hasNodesin classPersistentTrieSet.AbstractSetNode<K>
-
nodeArity
int nodeArity()
- Specified by:
nodeArityin classPersistentTrieSet.AbstractSetNode<K>
-
arity
int arity()
Description copied from class:PersistentTrieSet.AbstractSetNodeThe arity of this trie node (i.e. number of values and nodes stored on this level).- Overrides:
arityin classPersistentTrieSet.AbstractSetNode<K>- Returns:
- sum of nodes and values stored within
-
sizePredicate
public byte sizePredicate()
Description copied from interface:Node- Returns:
- size predicate
-
getKey
public K getKey(int index)
-
getKeyHash
public int getKeyHash(int index)
-
getNode
public PersistentTrieSet.CompactSetNode<K> getNode(int index)
- Specified by:
getNodein classPersistentTrieSet.CompactSetNode<K>
-
getSlot
java.lang.Object getSlot(int index)
- Specified by:
getSlotin classPersistentTrieSet.AbstractSetNode<K>
-
hasSlots
boolean hasSlots()
- Specified by:
hasSlotsin classPersistentTrieSet.AbstractSetNode<K>
-
slotArity
int slotArity()
- Specified by:
slotArityin classPersistentTrieSet.AbstractSetNode<K>
-
localPayloadHashCode
int localPayloadHashCode()
- Specified by:
localPayloadHashCodein classPersistentTrieSet.AbstractSetNode<K>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
equivalent
public boolean equivalent(java.lang.Object other, EqualityComparator<java.lang.Object> cmp)
-
copyAndInsertValue
PersistentTrieSet.CompactSetNode<K> copyAndInsertValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key)
- Specified by:
copyAndInsertValuein classPersistentTrieSet.CompactSetNode<K>
-
copyAndRemoveValue
PersistentTrieSet.CompactSetNode<K> copyAndRemoveValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)
- Specified by:
copyAndRemoveValuein classPersistentTrieSet.CompactSetNode<K>
-
copyAndSetNode
PersistentTrieSet.CompactSetNode<K> copyAndSetNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)
- Specified by:
copyAndSetNodein classPersistentTrieSet.CompactSetNode<K>
-
copyAndMigrateFromInlineToNode
PersistentTrieSet.CompactSetNode<K> copyAndMigrateFromInlineToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)
- Specified by:
copyAndMigrateFromInlineToNodein classPersistentTrieSet.CompactSetNode<K>
-
copyAndMigrateFromNodeToInline
PersistentTrieSet.CompactSetNode<K> copyAndMigrateFromNodeToInline(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)
- Specified by:
copyAndMigrateFromNodeToInlinein classPersistentTrieSet.CompactSetNode<K>
-
nodeMap
final int nodeMap()
- Specified by:
nodeMapin classPersistentTrieSet.CompactSetNode<K>
-
dataMap
final int dataMap()
- Specified by:
dataMapin classPersistentTrieSet.CompactSetNode<K>
-
-