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>> Serializable,Iterable<K>
- Enclosing class:
PersistentTrieSet<K>
private static final class PersistentTrieSet.HashCollisionSetNode<K>
extends PersistentTrieSet.CompactSetNode<K>
-
Field Summary
FieldsFields inherited from class io.usethesource.capsule.core.PersistentTrieSet.CompactSetNode
BIT_PARTITION_MASK, BIT_PARTITION_SIZE, HASH_CODE_LENGTHFields inherited from class io.usethesource.capsule.core.PersistentTrieSet.AbstractSetNode
TUPLE_LENGTHFields inherited from interface io.usethesource.capsule.core.trie.Node
SIZE_EMPTY, SIZE_MORE_THAN_ONE, SIZE_ONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) intarity()The arity of this trie node (i.e.booleancontains(K key, int keyHash, int shift, EqualityComparator<Object> cmp) (package private) PersistentTrieSet.CompactSetNode<K> copyAndInsertValue(AtomicReference<Thread> mutator, int bitpos, K key) (package private) PersistentTrieSet.CompactSetNode<K> copyAndMigrateFromInlineToNode(AtomicReference<Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node) (package private) PersistentTrieSet.CompactSetNode<K> copyAndMigrateFromNodeToInline(AtomicReference<Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node) (package private) PersistentTrieSet.CompactSetNode<K> copyAndRemoveValue(AtomicReference<Thread> mutator, int bitpos) (package private) PersistentTrieSet.CompactSetNode<K> copyAndSetNode(AtomicReference<Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node) (package private) final intdataMap()booleanbooleanequivalent(Object other, EqualityComparator<Object> cmp) findByKey(K key, int keyHash, int shift, EqualityComparator<Object> cmp) getKey(int index) intgetKeyHash(int index) getNode(int index) (package private) ObjectgetSlot(int index) inthashCode()(package private) booleanhasNodes()boolean(package private) booleanhasSlots()(package private) int(package private) int(package private) final intnodeMap()intremoved(AtomicReference<Thread> mutator, K key, int keyHash, int shift, SetNodeResult<K> details, EqualityComparator<Object> cmp) byteAbstract predicate over a node's size.(package private) intupdated(AtomicReference<Thread> mutator, K key, int keyHash, int shift, SetNodeResult<K> details, EqualityComparator<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, toStringMethods inherited from class io.usethesource.capsule.core.PersistentTrieSet.AbstractSetNode
dataArray, isAllowedToEdit, iterator, nodeIterator, recursivePayloadHashCode, size, spliterator, stream
-
Field Details
-
keys
-
hash
private final int hash
-
-
Constructor Details
-
HashCollisionSetNode
HashCollisionSetNode(int hash, K[] keys)
-
-
Method Details
-
nodeArray
- Specified by:
nodeArrayin interfaceNode- Specified by:
nodeArrayin classPersistentTrieSet.AbstractSetNode<K>
-
contains
- Specified by:
containsin interfaceSetNode<K,PersistentTrieSet.AbstractSetNode<K>> - Overrides:
containsin classPersistentTrieSet.CompactSetNode<K>
-
findByKey
- Specified by:
findByKeyin interfaceSetNode<K,PersistentTrieSet.AbstractSetNode<K>> - Overrides:
findByKeyin classPersistentTrieSet.CompactSetNode<K>
-
updated
public PersistentTrieSet.AbstractSetNode<K> updated(AtomicReference<Thread> mutator, K key, int keyHash, int shift, SetNodeResult<K> details, EqualityComparator<Object> cmp) - Specified by:
updatedin interfaceSetNode<K,PersistentTrieSet.AbstractSetNode<K>> - Overrides:
updatedin classPersistentTrieSet.CompactSetNode<K>
-
removed
public PersistentTrieSet.AbstractSetNode<K> removed(AtomicReference<Thread> mutator, K key, int keyHash, int shift, SetNodeResult<K> details, EqualityComparator<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
-
getKeyHash
public int getKeyHash(int index) -
getNode
- Specified by:
getNodein classPersistentTrieSet.CompactSetNode<K>
-
getSlot
- 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() -
equals
-
equivalent
-
copyAndInsertValue
PersistentTrieSet.CompactSetNode<K> copyAndInsertValue(AtomicReference<Thread> mutator, int bitpos, K key) - Specified by:
copyAndInsertValuein classPersistentTrieSet.CompactSetNode<K>
-
copyAndRemoveValue
- Specified by:
copyAndRemoveValuein classPersistentTrieSet.CompactSetNode<K>
-
copyAndSetNode
PersistentTrieSet.CompactSetNode<K> copyAndSetNode(AtomicReference<Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node) - Specified by:
copyAndSetNodein classPersistentTrieSet.CompactSetNode<K>
-
copyAndMigrateFromInlineToNode
PersistentTrieSet.CompactSetNode<K> copyAndMigrateFromInlineToNode(AtomicReference<Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node) - Specified by:
copyAndMigrateFromInlineToNodein classPersistentTrieSet.CompactSetNode<K>
-
copyAndMigrateFromNodeToInline
PersistentTrieSet.CompactSetNode<K> copyAndMigrateFromNodeToInline(AtomicReference<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>
-