Package io.usethesource.capsule.core
Class PersistentTrieSet.BitmapIndexedSetNode<K>
java.lang.Object
io.usethesource.capsule.core.PersistentTrieSet.AbstractSetNode<K>
io.usethesource.capsule.core.PersistentTrieSet.CompactSetNode<K>
io.usethesource.capsule.core.PersistentTrieSet.CompactMixedSetNode<K>
io.usethesource.capsule.core.PersistentTrieSet.BitmapIndexedSetNode<K>
- All Implemented Interfaces:
Node
,SetNode<K,
,PersistentTrieSet.AbstractSetNode<K>> Serializable
,Iterable<K>
- Enclosing class:
PersistentTrieSet<K>
private static final class PersistentTrieSet.BitmapIndexedSetNode<K>
extends PersistentTrieSet.CompactMixedSetNode<K>
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final AtomicReference
<Thread> (package private) final Object[]
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
ConstructorsModifierConstructorDescriptionprivate
BitmapIndexedSetNode
(AtomicReference<Thread> mutator, int nodeMap, int dataMap, Object[] nodes) -
Method Summary
Modifier and TypeMethodDescription(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> newNode) private final boolean
deepContentEquality
(Object[] a1, Object[] a2, int splitAt, int length, EqualityComparator<Object> cmp) boolean
boolean
equivalent
(Object other, EqualityComparator<Object> cmp) getKey
(int index) int
getKeyHash
(int index) (package private) PersistentTrieSet.CompactSetNode
<K> 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
int
int
final int
size()
byte
Abstract predicate over a node's size.(package private) int
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSet.CompactMixedSetNode
dataMap, nodeMap
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSet.CompactSetNode
bitpos, contains, dataIndex, findByKey, index, index, mask, mergeTwoKeyValPairs, nodeAt, nodeIndex, nodeInvariant, nodeOf, nodeOf, nodeOf, nodeOf, nodeOf, recoverMask, removed, toString, updated
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSet.AbstractSetNode
arity, dataArray, isAllowedToEdit, iterator, nodeIterator, spliterator, stream
-
Field Details
-
mutator
-
nodes
-
-
Constructor Details
-
BitmapIndexedSetNode
private BitmapIndexedSetNode(AtomicReference<Thread> mutator, int nodeMap, int dataMap, Object[] nodes)
-
-
Method Details
-
nodeArray
- Specified by:
nodeArray
in interfaceNode
- Specified by:
nodeArray
in classPersistentTrieSet.AbstractSetNode<K>
-
getKey
-
getKeyHash
public int getKeyHash(int index) -
getNode
- Specified by:
getNode
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>
-
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
-
deepContentEquality
private final boolean deepContentEquality(Object[] a1, Object[] a2, int splitAt, int length, EqualityComparator<Object> cmp) -
sizePredicate
public byte sizePredicate()Description copied from interface:Node
- Returns:
- size predicate
-
size
public final int size()- Specified by:
size
in interfaceSetNode<K,
PersistentTrieSet.AbstractSetNode<K>> - Overrides:
size
in classPersistentTrieSet.AbstractSetNode<K>
-
recursivePayloadHashCode
public int recursivePayloadHashCode()- Specified by:
recursivePayloadHashCode
in interfaceSetNode<K,
PersistentTrieSet.AbstractSetNode<K>> - Overrides:
recursivePayloadHashCode
in classPersistentTrieSet.AbstractSetNode<K>
-
copyAndSetNode
PersistentTrieSet.CompactSetNode<K> copyAndSetNode(AtomicReference<Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> newNode) - Specified by:
copyAndSetNode
in classPersistentTrieSet.CompactSetNode<K>
-
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>
-
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>
-