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_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 -
Method Summary
Modifier and TypeMethodDescription(package private) int
arity()
The arity of this trie node (i.e.boolean
contains
(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 int
dataMap()
boolean
boolean
equivalent
(Object other, EqualityComparator<Object> cmp) findByKey
(K key, int keyHash, int shift, EqualityComparator<Object> cmp) getKey
(int index) int
getKeyHash
(int index) getNode
(int index) (package private) Object
getSlot
(int index) int
hashCode()
(package private) boolean
hasNodes()
boolean
(package private) boolean
hasSlots()
(package private) int
(package private) int
(package private) final int
nodeMap()
int
removed
(AtomicReference<Thread> mutator, K key, int keyHash, int shift, SetNodeResult<K> details, EqualityComparator<Object> cmp) byte
Abstract predicate over a node's size.(package private) int
updated
(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, toString
Methods 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:
nodeArray
in interfaceNode
- Specified by:
nodeArray
in classPersistentTrieSet.AbstractSetNode<K>
-
contains
- Specified by:
contains
in interfaceSetNode<K,
PersistentTrieSet.AbstractSetNode<K>> - Overrides:
contains
in classPersistentTrieSet.CompactSetNode<K>
-
findByKey
- Specified by:
findByKey
in interfaceSetNode<K,
PersistentTrieSet.AbstractSetNode<K>> - Overrides:
findByKey
in 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:
updated
in interfaceSetNode<K,
PersistentTrieSet.AbstractSetNode<K>> - Overrides:
updated
in 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:
removed
in interfaceSetNode<K,
PersistentTrieSet.AbstractSetNode<K>> - Overrides:
removed
in classPersistentTrieSet.CompactSetNode<K>
-
hasPayload
public boolean hasPayload() -
payloadArity
public int payloadArity() -
hasNodes
boolean hasNodes()- Specified by:
hasNodes
in classPersistentTrieSet.AbstractSetNode<K>
-
nodeArity
int nodeArity()- Specified by:
nodeArity
in classPersistentTrieSet.AbstractSetNode<K>
-
arity
int arity()Description copied from class:PersistentTrieSet.AbstractSetNode
The arity of this trie node (i.e. number of values and nodes stored on this level).- Overrides:
arity
in 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:
getNode
in classPersistentTrieSet.CompactSetNode<K>
-
getSlot
- Specified by:
getSlot
in classPersistentTrieSet.AbstractSetNode<K>
-
hasSlots
boolean hasSlots()- Specified by:
hasSlots
in classPersistentTrieSet.AbstractSetNode<K>
-
slotArity
int slotArity()- Specified by:
slotArity
in classPersistentTrieSet.AbstractSetNode<K>
-
localPayloadHashCode
int localPayloadHashCode()- Specified by:
localPayloadHashCode
in classPersistentTrieSet.AbstractSetNode<K>
-
hashCode
public int hashCode() -
equals
-
equivalent
-
copyAndInsertValue
PersistentTrieSet.CompactSetNode<K> copyAndInsertValue(AtomicReference<Thread> mutator, int bitpos, K key) - Specified by:
copyAndInsertValue
in classPersistentTrieSet.CompactSetNode<K>
-
copyAndRemoveValue
- Specified by:
copyAndRemoveValue
in classPersistentTrieSet.CompactSetNode<K>
-
copyAndSetNode
PersistentTrieSet.CompactSetNode<K> copyAndSetNode(AtomicReference<Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node) - Specified by:
copyAndSetNode
in classPersistentTrieSet.CompactSetNode<K>
-
copyAndMigrateFromInlineToNode
PersistentTrieSet.CompactSetNode<K> copyAndMigrateFromInlineToNode(AtomicReference<Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node) - Specified by:
copyAndMigrateFromInlineToNode
in classPersistentTrieSet.CompactSetNode<K>
-
copyAndMigrateFromNodeToInline
PersistentTrieSet.CompactSetNode<K> copyAndMigrateFromNodeToInline(AtomicReference<Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node) - Specified by:
copyAndMigrateFromNodeToInline
in classPersistentTrieSet.CompactSetNode<K>
-
nodeMap
final int nodeMap()- Specified by:
nodeMap
in classPersistentTrieSet.CompactSetNode<K>
-
dataMap
final int dataMap()- Specified by:
dataMap
in classPersistentTrieSet.CompactSetNode<K>
-