Package io.usethesource.capsule.core
Class PersistentTrieSetMultimap.BitmapIndexedSetMultimapNode<K,V>
- java.lang.Object
-
- io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
- io.usethesource.capsule.core.PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
- io.usethesource.capsule.core.PersistentTrieSetMultimap.CompactMixedSetMultimapNode<K,V>
-
- io.usethesource.capsule.core.PersistentTrieSetMultimap.BitmapIndexedSetMultimapNode<K,V>
-
- All Implemented Interfaces:
MultimapNode<K,V,Set.Immutable<V>,PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
,Node
,java.io.Serializable
- Enclosing class:
- PersistentTrieSetMultimap<K,V>
private static final class PersistentTrieSetMultimap.BitmapIndexedSetMultimapNode<K,V> extends PersistentTrieSetMultimap.CompactMixedSetMultimapNode<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.concurrent.atomic.AtomicReference<java.lang.Thread>
mutator
(package private) java.lang.Object[]
nodes
-
Fields inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.CompactSetMultimapNode
BIT_PARTITION_MASK, BIT_PARTITION_SIZE, EMPTY_NODE, 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 private
BitmapIndexedSetMultimapNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int rawMap1, int rawMap2, java.lang.Object[] nodes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
canonicalize(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int keyHash, int shift)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndInsertCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, Set.Immutable<V> valColl)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndInsertSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, V val)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromCollectionToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromCollectionToSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, V val)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromNodeToCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromNodeToSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
private java.lang.Object[]
copyAndMigrateFromNodeToXxx(int idxOld, int idxNew, java.lang.Object keyToInline, java.lang.Object valToInline)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromSingletonToCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, Set.Immutable<V> valColl)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndMigrateFromSingletonToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
private java.lang.Object[]
copyAndMigrateFromXxxToNode(int idxOld, int idxNew, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndRemoveCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndRemoveSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndSetCollectionValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, Set.Immutable<V> valColl)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndSetNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndSetSingletonValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, V val)
private PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndSetXxxValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int idx, java.lang.Object newValue)
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
copyAndUpdateBitmaps(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int rawMap1, int rawMap2)
boolean
equals(java.lang.Object other)
(package private) K
getCollectionKey(int index)
(package private) Set.Immutable<V>
getCollectionValue(int index)
(package private) PersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
getNode(int index)
(package private) K
getSingletonKey(int index)
(package private) V
getSingletonValue(int index)
(package private) java.lang.Object
getSlot(int index)
int
hashCode()
(package private) boolean
hasNodes()
(package private) boolean
hasPayload(EitherSingletonOrCollection.Type type)
(package private) boolean
hasSlots()
(package private) int
nodeArity()
ArrayView<PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>>
nodeArray()
(package private) int
payloadArity(EitherSingletonOrCollection.Type type)
byte
sizePredicate()
Abstract predicate over a node's size.(package private) int
slotArity()
EitherSingletonOrCollection.Type
typeOfSingleton()
private <T> java.util.Iterator<T>
ziperator(int expectedSize, int bitmap0, java.util.Iterator<T> dataIterator0, int bitmap1, java.util.Iterator<T> dataIterator1)
-
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.CompactMixedSetMultimapNode
bitmap, collMap, dataMap, nodeMap, rawMap1, rawMap2
-
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.CompactSetMultimapNode
arity, arity, bitpos, collIndex, containsKey, containsTuple, dataIndex, findByKey, index, index, insertedMultiple, insertedSingle, mask, mergeCollectionAndSingletonPairs, mergeTwoCollectionPairs, mergeTwoSingletonPairs, nodeIndex, nodeInvariant, nodeOf, nodeOf, nodeOf, recoverMask, removed, removed, toString, updated, updatedMultiple, updatedSingle
-
Methods inherited from class io.usethesource.capsule.core.PersistentTrieSetMultimap.AbstractSetMultimapNode
dataArray, isAllowedToEdit, mustUnbox, nodeIterator, size, unbox
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.usethesource.capsule.core.trie.MultimapNode
copyAndUpdateBitmaps, inserted, patternOfSingleton
-
-
-
-
Method Detail
-
nodeArray
public ArrayView<PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>> nodeArray()
-
getSingletonKey
K getSingletonKey(int index)
- Specified by:
getSingletonKey
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getSingletonValue
V getSingletonValue(int index)
- Specified by:
getSingletonValue
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getCollectionKey
K getCollectionKey(int index)
- Specified by:
getCollectionKey
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getCollectionValue
Set.Immutable<V> getCollectionValue(int index)
- Specified by:
getCollectionValue
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getNode
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> getNode(int index)
- Specified by:
getNode
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
hasPayload
boolean hasPayload(EitherSingletonOrCollection.Type type)
- Specified by:
hasPayload
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
payloadArity
int payloadArity(EitherSingletonOrCollection.Type type)
- Specified by:
payloadArity
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
hasNodes
boolean hasNodes()
- Specified by:
hasNodes
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
nodeArity
int nodeArity()
- Specified by:
nodeArity
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
getSlot
java.lang.Object getSlot(int index)
- Specified by:
getSlot
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
ziperator
private <T> java.util.Iterator<T> ziperator(int expectedSize, int bitmap0, java.util.Iterator<T> dataIterator0, int bitmap1, java.util.Iterator<T> dataIterator1)
-
hasSlots
boolean hasSlots()
- Specified by:
hasSlots
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
slotArity
int slotArity()
- Specified by:
slotArity
in classPersistentTrieSetMultimap.AbstractSetMultimapNode<K,V>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
sizePredicate
public byte sizePredicate()
Description copied from interface:Node
- Returns:
- size predicate
-
copyAndSetSingletonValue
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndSetSingletonValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, V val)
- Specified by:
copyAndSetSingletonValue
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndSetCollectionValue
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndSetCollectionValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, Set.Immutable<V> valColl)
- Specified by:
copyAndSetCollectionValue
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndSetXxxValue
private PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndSetXxxValue(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int idx, java.lang.Object newValue)
-
copyAndSetNode
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndSetNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
- Specified by:
copyAndSetNode
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndInsertSingleton
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndInsertSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, V val)
- Specified by:
copyAndInsertSingleton
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndInsertCollection
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndInsertCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, Set.Immutable<V> valColl)
- Specified by:
copyAndInsertCollection
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndMigrateFromSingletonToCollection
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromSingletonToCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, Set.Immutable<V> valColl)
- Specified by:
copyAndMigrateFromSingletonToCollection
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndMigrateFromCollectionToSingleton
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromCollectionToSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, K key, V val)
- Specified by:
copyAndMigrateFromCollectionToSingleton
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndRemoveSingleton
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndRemoveSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)
- Specified by:
copyAndRemoveSingleton
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndRemoveCollection
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndRemoveCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos)
- Specified by:
copyAndRemoveCollection
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndMigrateFromSingletonToNode
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromSingletonToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
- Specified by:
copyAndMigrateFromSingletonToNode
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndMigrateFromCollectionToNode
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromCollectionToNode(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
- Specified by:
copyAndMigrateFromCollectionToNode
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndMigrateFromXxxToNode
private java.lang.Object[] copyAndMigrateFromXxxToNode(int idxOld, int idxNew, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
-
copyAndMigrateFromNodeToSingleton
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromNodeToSingleton(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
- Specified by:
copyAndMigrateFromNodeToSingleton
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndMigrateFromNodeToCollection
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndMigrateFromNodeToCollection(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int bitpos, PersistentTrieSetMultimap.AbstractSetMultimapNode<K,V> node)
- Specified by:
copyAndMigrateFromNodeToCollection
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
copyAndMigrateFromNodeToXxx
private java.lang.Object[] copyAndMigrateFromNodeToXxx(int idxOld, int idxNew, java.lang.Object keyToInline, java.lang.Object valToInline)
-
copyAndUpdateBitmaps
public PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> copyAndUpdateBitmaps(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int rawMap1, int rawMap2)
-
typeOfSingleton
public EitherSingletonOrCollection.Type typeOfSingleton()
-
canonicalize
PersistentTrieSetMultimap.CompactSetMultimapNode<K,V> canonicalize(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, int keyHash, int shift)
- Specified by:
canonicalize
in classPersistentTrieSetMultimap.CompactSetMultimapNode<K,V>
-
-