Package io.usethesource.capsule.core
Class PersistentTrieSet.CompactSetNode<K>
- java.lang.Object
-
- io.usethesource.capsule.core.PersistentTrieSet.AbstractSetNode<K>
-
- io.usethesource.capsule.core.PersistentTrieSet.CompactSetNode<K>
-
- All Implemented Interfaces:
Node,SetNode<K,PersistentTrieSet.AbstractSetNode<K>>,java.io.Serializable,java.lang.Iterable<K>
- Direct Known Subclasses:
PersistentTrieSet.CompactMixedSetNode,PersistentTrieSet.HashCollisionSetNode
- Enclosing class:
- PersistentTrieSet<K>
protected abstract static class PersistentTrieSet.CompactSetNode<K> extends PersistentTrieSet.AbstractSetNode<K>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static intBIT_PARTITION_MASK(package private) static intBIT_PARTITION_SIZE(package private) static intHASH_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 Modifier Constructor Description protectedCompactSetNode()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) static intbitpos(int mask)booleancontains(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)(package private) abstract PersistentTrieSet.CompactSetNode<K>copyAndInsertValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key)(package private) abstract PersistentTrieSet.CompactSetNode<K>copyAndMigrateFromInlineToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)(package private) abstract PersistentTrieSet.CompactSetNode<K>copyAndMigrateFromNodeToInline(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)(package private) abstract PersistentTrieSet.CompactSetNode<K>copyAndRemoveValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)(package private) abstract PersistentTrieSet.CompactSetNode<K>copyAndSetNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)(package private) intdataIndex(int bitpos)(package private) abstract intdataMap()java.util.Optional<K>findByKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)(package private) abstract PersistentTrieSet.CompactSetNode<K>getNode(int index)(package private) static intindex(int bitmap, int bitpos)(package private) static intindex(int bitmap, int mask, int bitpos)(package private) static intmask(int keyHash, int shift)(package private) static <K> PersistentTrieSet.CompactSetNode<K>mergeTwoKeyValPairs(K key0, int keyHash0, K key1, int keyHash1, int shift)(package private) PersistentTrieSet.CompactSetNode<K>nodeAt(int bitpos)(package private) intnodeIndex(int bitpos)(package private) booleannodeInvariant()(package private) abstract intnodeMap()(package private) static <K> PersistentTrieSet.CompactSetNode<K>nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator)(package private) static <K> PersistentTrieSet.CompactSetNode<K>nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int nodeMap, int dataMap, java.lang.Object[] nodes)(package private) static <K> PersistentTrieSet.CompactSetNode<K>nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int nodeMap, PersistentTrieSet.AbstractSetNode<K> node)(package private) static <K> PersistentTrieSet.CompactSetNode<K>nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int dataMap, K key, int keyHash)(package private) static <K> PersistentTrieSet.CompactSetNode<K>nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int dataMap, K key0, int keyHash0, K key1, int keyHash1)(package private) static byterecoverMask(int map, byte i_th)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)java.lang.StringtoString()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.AbstractSetNode
arity, dataArray, getSlot, hasNodes, hasSlots, isAllowedToEdit, iterator, localPayloadHashCode, nodeArity, nodeArray, nodeIterator, recursivePayloadHashCode, size, slotArity, spliterator, stream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.usethesource.capsule.core.trie.Node
sizePredicate
-
Methods inherited from interface io.usethesource.capsule.core.trie.SetNode
equivalent, findFirst, getKey, getKeyHash, getPayload, hasPayload, intersect, payloadArity, subtract, union
-
-
-
-
Field Detail
-
HASH_CODE_LENGTH
static final int HASH_CODE_LENGTH
- See Also:
- Constant Field Values
-
BIT_PARTITION_SIZE
static final int BIT_PARTITION_SIZE
- See Also:
- Constant Field Values
-
BIT_PARTITION_MASK
static final int BIT_PARTITION_MASK
- See Also:
- Constant Field Values
-
-
Method Detail
-
mask
static final int mask(int keyHash, int shift)
-
bitpos
static final int bitpos(int mask)
-
nodeMap
abstract int nodeMap()
-
dataMap
abstract int dataMap()
-
getNode
abstract PersistentTrieSet.CompactSetNode<K> getNode(int index)
- Specified by:
getNodein classPersistentTrieSet.AbstractSetNode<K>
-
nodeInvariant
boolean nodeInvariant()
-
copyAndInsertValue
abstract PersistentTrieSet.CompactSetNode<K> copyAndInsertValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key)
-
copyAndRemoveValue
abstract PersistentTrieSet.CompactSetNode<K> copyAndRemoveValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)
-
copyAndSetNode
abstract PersistentTrieSet.CompactSetNode<K> copyAndSetNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)
-
copyAndMigrateFromInlineToNode
abstract PersistentTrieSet.CompactSetNode<K> copyAndMigrateFromInlineToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)
-
copyAndMigrateFromNodeToInline
abstract PersistentTrieSet.CompactSetNode<K> copyAndMigrateFromNodeToInline(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSet.AbstractSetNode<K> node)
-
mergeTwoKeyValPairs
static final <K> PersistentTrieSet.CompactSetNode<K> mergeTwoKeyValPairs(K key0, int keyHash0, K key1, int keyHash1, int shift)
-
nodeOf
static final <K> PersistentTrieSet.CompactSetNode<K> nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int nodeMap, int dataMap, java.lang.Object[] nodes)
-
nodeOf
static final <K> PersistentTrieSet.CompactSetNode<K> nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator)
-
nodeOf
static final <K> PersistentTrieSet.CompactSetNode<K> nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int dataMap, K key, int keyHash)
-
nodeOf
static final <K> PersistentTrieSet.CompactSetNode<K> nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int dataMap, K key0, int keyHash0, K key1, int keyHash1)
-
nodeOf
static final <K> PersistentTrieSet.CompactSetNode<K> nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int nodeMap, PersistentTrieSet.AbstractSetNode<K> node)
-
index
static final int index(int bitmap, int bitpos)
-
index
static final int index(int bitmap, int mask, int bitpos)
-
dataIndex
int dataIndex(int bitpos)
-
nodeIndex
int nodeIndex(int bitpos)
-
nodeAt
PersistentTrieSet.CompactSetNode<K> nodeAt(int bitpos)
-
contains
public boolean contains(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
-
findByKey
public java.util.Optional<K> findByKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
-
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)
-
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)
-
recoverMask
static byte recoverMask(int map, byte i_th)- Returns:
- 0 <= mask <= 2^BIT_PARTITION_SIZE - 1
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-