Package io.usethesource.capsule.core
Class PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
- java.lang.Object
-
- io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
- io.usethesource.capsule.core.PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
- All Implemented Interfaces:
MultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
,Node
,java.io.Serializable
- Direct Known Subclasses:
PersistentTrieSetMultimap.AbstractHashCollisionNode
,PersistentTrieSetMultimap.CompactMixedSetMultimapNode
- Enclosing class:
- PersistentTrieSetMultimap<K,V>
protected abstract static class PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> extends PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
BIT_PARTITION_MASK
(package private) static int
BIT_PARTITION_SIZE
(package private) static PersistentTrieSetMultimap.CompactSetMultimapNode
EMPTY_NODE
(package private) static int
HASH_CODE_LENGTH
-
Fields inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractSetMultimapNode
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 protected
CompactSetMultimapNode()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) int
arity()
Deprecated.(package private) static int
arity(int bitmap)
(package private) abstract int
bitmap(int category)
(package private) static int
bitpos(int mask)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
canonicalize(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int keyHash, int shift)
(package private) int
collIndex(int bitpos)
Deprecated.(package private) abstract int
collMap()
Deprecated.boolean
containsKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
boolean
containsTuple(K key, V value, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndInsertCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, Set.Immutable<V> values)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndInsertSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, V val)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromCollectionToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromCollectionToSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, V val)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromNodeToCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromNodeToSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromSingletonToCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, Set.Immutable<V> valColl)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromSingletonToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndRemoveCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndRemoveSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndSetCollectionValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, Set.Immutable<V> valColl)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndSetNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndSetSingletonValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, V val)
(package private) int
dataIndex(int bitpos)
Deprecated.(package private) abstract int
dataMap()
Deprecated.java.util.Optional<Set.Immutable<V>>
findByKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
(package private) abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
getNode(int index)
(package private) static int
index(int bitmap, int bitpos)
(package private) static int
index(int bitmap, int mask, int bitpos)
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
insertedMultiple(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
insertedSingle(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
(package private) static int
mask(int keyHash, int shift)
(package private) static <K,V>
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>mergeCollectionAndSingletonPairs(K key0, Set.Immutable<V> valColl0, int keyHash0, K key1, V val1, int keyHash1, int shift, EqualityComparator<java.lang.Object> cmp)
(package private) static <K,V,C extends Set.Immutable<V>>
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>mergeTwoCollectionPairs(K key0, C valColl0, int keyHash0, K key1, C valColl1, int keyHash1, int shift, EqualityComparator<java.lang.Object> cmp)
(package private) static <K,V>
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>mergeTwoSingletonPairs(K key0, V val0, int keyHash0, K key1, V val1, int keyHash1, int shift, EqualityComparator<java.lang.Object> cmp)
(package private) int
nodeIndex(int bitpos)
Deprecated.(package private) boolean
nodeInvariant()
(package private) abstract int
nodeMap()
Deprecated.(package private) static <K,V>
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator)
(package private) static <K,V>
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int nodeMap, int dataMap, java.lang.Object[] nodes)
(package private) static <K,V>
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int nodeMap, int dataMap, K key, Set.Immutable<V> valColl)
(package private) abstract int
rawMap1()
(package private) abstract int
rawMap2()
(package private) static byte
recoverMask(int map, byte i_th)
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
removed(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
Removes all values associated withkey
.PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
removed(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
Removes thekey
/val
tuple.java.lang.String
toString()
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
updated(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
updatedMultiple(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
updatedSingle(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
-
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractSetMultimapNode
dataArray, getCollectionKey, getCollectionValue, getSingletonKey, getSingletonValue, getSlot, hasNodes, hasPayload, hasSlots, isAllowedToEdit, mustUnbox, nodeArity, nodeArray, nodeIterator, payloadArity, size, slotArity, unbox
-
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.MultimapNode
copyAndUpdateBitmaps, inserted, patternOfSingleton, typeOfSingleton
-
Methods inherited from interface io.usethesource.capsule.core.trie.Node
sizePredicate
-
-
-
-
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
-
EMPTY_NODE
static final PersistentTrieSetMultimap.CompactSetMultimapNode EMPTY_NODE
-
-
Method Detail
-
mask
static final int mask(int keyHash, int shift)
-
bitpos
static final int bitpos(int mask)
-
bitmap
abstract int bitmap(int category)
-
dataMap
@Deprecated abstract int dataMap()
Deprecated.
-
collMap
@Deprecated abstract int collMap()
Deprecated.
-
nodeMap
@Deprecated abstract int nodeMap()
Deprecated.
-
rawMap1
abstract int rawMap1()
-
rawMap2
abstract int rawMap2()
-
arity
@Deprecated int arity()
Deprecated.Description copied from class:PersistentTrieSetMultimap.AbstractSetMultimapNode
The arity of this trie node (i.e. number of values and nodes stored on this level).- Specified by:
arity
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
- Returns:
- sum of nodes and values stored within
-
arity
static final int arity(int bitmap)
-
getNode
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> getNode(int index)
- Specified by:
getNode
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
nodeInvariant
boolean nodeInvariant()
-
copyAndSetSingletonValue
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndSetSingletonValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, V val)
-
copyAndSetCollectionValue
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndSetCollectionValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, Set.Immutable<V> valColl)
-
copyAndSetNode
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndSetNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
-
copyAndInsertSingleton
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndInsertSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, V val)
-
copyAndInsertCollection
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndInsertCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, Set.Immutable<V> values)
-
copyAndMigrateFromSingletonToCollection
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromSingletonToCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, Set.Immutable<V> valColl)
-
copyAndRemoveSingleton
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndRemoveSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)
-
copyAndRemoveCollection
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndRemoveCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)
-
copyAndMigrateFromSingletonToNode
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromSingletonToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
-
copyAndMigrateFromNodeToSingleton
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromNodeToSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
-
copyAndMigrateFromCollectionToNode
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromCollectionToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
-
copyAndMigrateFromNodeToCollection
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromNodeToCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
-
copyAndMigrateFromCollectionToSingleton
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromCollectionToSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, V val)
-
mergeTwoSingletonPairs
static final <K,V> PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> mergeTwoSingletonPairs(K key0, V val0, int keyHash0, K key1, V val1, int keyHash1, int shift, EqualityComparator<java.lang.Object> cmp)
-
mergeCollectionAndSingletonPairs
static final <K,V> PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> mergeCollectionAndSingletonPairs(K key0, Set.Immutable<V> valColl0, int keyHash0, K key1, V val1, int keyHash1, int shift, EqualityComparator<java.lang.Object> cmp)
-
mergeTwoCollectionPairs
static final <K,V,C extends Set.Immutable<V>> PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> mergeTwoCollectionPairs(K key0, C valColl0, int keyHash0, K key1, C valColl1, int keyHash1, int shift, EqualityComparator<java.lang.Object> cmp)
-
nodeOf
static final <K,V> PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int nodeMap, int dataMap, java.lang.Object[] nodes)
-
nodeOf
static final <K,V> PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator)
-
nodeOf
static final <K,V> PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> nodeOf(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int nodeMap, int dataMap, K key, Set.Immutable<V> valColl)
-
index
static final int index(int bitmap, int bitpos)
-
index
static final int index(int bitmap, int mask, int bitpos)
-
dataIndex
@Deprecated final int dataIndex(int bitpos)
Deprecated.
-
collIndex
@Deprecated final int collIndex(int bitpos)
Deprecated.
-
nodeIndex
@Deprecated final int nodeIndex(int bitpos)
Deprecated.
-
containsKey
public boolean containsKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
-
containsTuple
public boolean containsTuple(K key, V value, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
-
findByKey
public java.util.Optional<Set.Immutable<V>> findByKey(K key, int keyHash, int shift, EqualityComparator<java.lang.Object> cmp)
-
insertedSingle
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> insertedSingle(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
-
insertedMultiple
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> insertedMultiple(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
-
updated
public final PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> updated(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
-
updatedSingle
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> updatedSingle(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
-
updatedMultiple
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> updatedMultiple(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, Set.Immutable<V> values, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
-
removed
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> removed(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, V value, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
Description copied from interface:MultimapNode
Removes thekey
/val
tuple.
-
removed
public PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> removed(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, int keyHash, int shift, MultimapResult<K,V,Set.Immutable<V>> details, EqualityComparator<java.lang.Object> cmp)
Description copied from interface:MultimapNode
Removes all values associated withkey
.
-
canonicalize
abstract PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> canonicalize(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int keyHash, int shift)
-
recoverMask
static byte recoverMask(int map, byte i_th)
- Returns:
- 0 <= mask <= 2^BIT_PARTITION_SIZE - 1
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-