Package io.usethesource.capsule.core
Class AbstractTrieSetMultimap<K,V,C extends Iterable<V>,R extends MultimapNode<K,V,C,R>>
java.lang.Object
io.usethesource.capsule.core.AbstractTrieSetMultimap<K,V,C,R>
- All Implemented Interfaces:
SetMultimap<K,
,V> Serializable
- Direct Known Subclasses:
AbstractPersistentTrieSetMultimap
,AbstractTransientTrieSetMultimap
public abstract class AbstractTrieSetMultimap<K,V,C extends Iterable<V>,R extends MultimapNode<K,V,C,R>>
extends Object
implements SetMultimap<K,V>, Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
AbstractTrieSetMultimap.AbstractSetMultimapIterator<K,
V, C, R extends MultimapNode<K, V, C, R>> Iterator skeleton that uses a fixed stack in depth.protected static class
AbstractTrieSetMultimap.SetMultimapKeyIterator<K,
V, C, R extends MultimapNode<K, V, C, R>> protected static class
AbstractTrieSetMultimap.SetMultimapNativeTupleIterator<K,
V, C, R extends MultimapNode<K, V, C, R>> protected static class
AbstractTrieSetMultimap.SetMultimapTupleIterator<K,
V, C extends Iterable<V>, R extends MultimapNode<K, V, C, R>, T> protected static class
AbstractTrieSetMultimap.SetMultimapValueIterator<K,
V, C, R extends MultimapNode<K, V, C, R>> private static class
AbstractTrieSetMultimap.TrieSetMultimap_BleedingEdgeNodeIterator<K,
V, C, R extends MultimapNode<K, V, C, R>> Iterator that first iterates over inlined-values and then continues depth first recursively.Nested classes/interfaces inherited from interface io.usethesource.capsule.SetMultimap
SetMultimap.Immutable<K,
V>, SetMultimap.Transient<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EqualityComparator
<Object> private static final long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static final <K,
V> boolean checkHashCodeAndSize
(int targetHash, int targetSize, Iterator<Map.Entry<K, V>> iterator) private static final <K> boolean
checkKeySetHashCodeAndSize
(int targetHash, int targetSize, Iterator<K> iterator) protected abstract C
collectionToInternalFormat
(Set.Immutable<V> valueCollection) final boolean
containsEntry
(Object o0, Object o1) final boolean
final boolean
entrySet()
boolean
Compares the specified object for equality against this multimap.final Set.Immutable
<V> (package private) abstract int
(package private) abstract int
(package private) abstract int
protected int
(package private) abstract R
int
hashCode()
Returns the hash code for this multimap.protected static <K,
V, C extends Iterable<V>, R extends MultimapNode<K, V, C, R>>
inthashCode
(R rootNode) protected abstract Set.Immutable
<V> internalFormatToCollection
(C values) keySet()
protected static <K,
V, C extends Iterable<V>, R extends MultimapNode<K, V, C, R>>
intkeySetHashCode
(R rootNode) protected static <K,
V, C extends Iterable<V>, R extends MultimapNode<K, V, C, R>>
intkeySetSize
(R rootNode) Iterates over the raw internal structure.protected static <K,
V, C extends Iterable<V>, R extends MultimapNode<K, V, C, R>>
intsize
(R rootNode) toString()
static final int
transformHashCode
(int hash) private static final <K,
V> int tupleHash
(int keyHash, int valueHash) private static final <K,
V, C extends Collection<V>>
inttupleHash
(int keyHash, C values) private static final <K,
V> int tupleHash
(int keyHash, V value) private static final <K,
V, C extends Collection<V>>
inttupleHash
(K key, C values) private static final <K,
V> int tupleHash
(K key, V value) <T> Iterator
<T> tupleIterator
(BiFunction<K, V, T> tupleOf) private Spliterator
<C> valueCollectionsSpliterator
(Function<V, C> converter) valueCollectionsStream
(Function<V, C> converter) valueIterator
(Function<V, C> converter) final Collection
<V> values()
protected abstract Set.Immutable
<V> valueToTemporaryBox
(V value) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.usethesource.capsule.SetMultimap
isEmpty, size, sizeDistinct, tupleStream
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
cmp
-
-
Constructor Details
-
AbstractTrieSetMultimap
-
-
Method Details
-
getRootNode
-
getCachedSize
abstract int getCachedSize() -
getCachedKeySetHashCode
abstract int getCachedKeySetHashCode() -
getCachedKeySetSize
abstract int getCachedKeySetSize() -
valueToTemporaryBox
-
collectionToInternalFormat
-
internalFormatToCollection
-
tupleHash
private static final <K,V> int tupleHash(int keyHash, int valueHash) -
tupleHash
private static final <K,V> int tupleHash(int keyHash, V value) -
tupleHash
private static final <K,V> int tupleHash(K key, V value) -
tupleHash
-
tupleHash
-
transformHashCode
public static final int transformHashCode(int hash) -
hashCode
protected static <K,V, int hashCodeC extends Iterable<V>, R extends MultimapNode<K, V, C, R>> (R rootNode) -
size
protected static <K,V, int sizeC extends Iterable<V>, R extends MultimapNode<K, V, C, R>> (R rootNode) -
keySetHashCode
protected static <K,V, int keySetHashCodeC extends Iterable<V>, R extends MultimapNode<K, V, C, R>> (R rootNode) -
keySetSize
protected static <K,V, int keySetSizeC extends Iterable<V>, R extends MultimapNode<K, V, C, R>> (R rootNode) -
checkHashCodeAndSize
-
checkKeySetHashCodeAndSize
private static final <K> boolean checkKeySetHashCodeAndSize(int targetHash, int targetSize, Iterator<K> iterator) -
nodeIterator
-
getNodeCount
protected int getNodeCount() -
containsKey
- Specified by:
containsKey
in interfaceSetMultimap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceSetMultimap<K,
V>
-
containsEntry
- Specified by:
containsEntry
in interfaceSetMultimap<K,
V>
-
get
- Specified by:
get
in interfaceSetMultimap<K,
V>
-
keyIterator
- Specified by:
keyIterator
in interfaceSetMultimap<K,
V>
-
valueIterator
- Specified by:
valueIterator
in interfaceSetMultimap<K,
V>
-
valueIterator
-
entryIterator
- Specified by:
entryIterator
in interfaceSetMultimap<K,
V>
-
nativeEntryIterator
Description copied from interface:SetMultimap
Iterates over the raw internal structure. Optional operation.- Specified by:
nativeEntryIterator
in interfaceSetMultimap<K,
V> - Returns:
- native iterator, if supported
-
tupleIterator
- Specified by:
tupleIterator
in interfaceSetMultimap<K,
V>
-
valueCollectionsSpliterator
-
valueCollectionsStream
-
keySet
- Specified by:
keySet
in interfaceSetMultimap<K,
V>
-
values
- Specified by:
values
in interfaceSetMultimap<K,
V>
-
entrySet
- Specified by:
entrySet
in interfaceSetMultimap<K,
V>
-
hashCode
public int hashCode()Description copied from interface:SetMultimap
-
equals
Description copied from interface:SetMultimap
-
toString
-