Package io.usethesource.capsule.core
Class PersistentTrieSet<K>
java.lang.Object
io.usethesource.capsule.core.PersistentTrieSet<K>
- All Implemented Interfaces:
Set<K>,Set.Immutable<K>,SetEq<K>,SetEq.Immutable<K>,Serializable,Iterable<K>,Collection<K>,Set<K>
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classIterator skeleton that uses a fixed stack in depth.protected static class(package private) static classprivate static final classprotected static classprotected static classprivate static final classprotected static class(package private) static final classprivate static classIterator that first iterates over inlined-values and then continues depth first recursively.Nested classes/interfaces inherited from interface io.usethesource.capsule.Set
Set.Immutable<K>, Set.Transient<K>Nested classes/interfaces inherited from interface io.usethesource.capsule.SetEq
SetEq.Immutable<K>, SetEq.Transient<K> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final intprivate static final booleanprivate static final PersistentTrieSet.CompactSetNodeprivate static final PersistentTrieSetprivate final PersistentTrieSet.AbstractSetNode<K> private static final long -
Constructor Summary
ConstructorsConstructorDescriptionPersistentTrieSet(PersistentTrieSet.AbstractSetNode<K> rootNode, int cachedHashCode, int cachedSize) -
Method Summary
Modifier and TypeMethodDescription__insertAll(Set<? extends K> set) __insertAllEquivalent(Set<? extends K> set, EqualityComparator<Object> cmp) __insertEquivalent(K key, EqualityComparator<Object> cmp) __removeAll(Set<? extends K> set) __removeAllEquivalent(Set<? extends K> set, EqualityComparator<Object> cmp) __removeEquivalent(K key, EqualityComparator<Object> cmp) __retainAll(Set<? extends K> set) __retainAllEquivalent(Set.Transient<? extends K> transientSet, EqualityComparator<Object> cmp) booleanbooleanaddAll(Collection<? extends K> c) protected int[][]protected int[]private booleancheckHashCodeAndSize(int targetHash, int targetSize) voidclear()booleanbooleancontainsAll(Collection<?> c) booleancontainsAllEquivalent(Collection<?> c, EqualityComparator<Object> cmp) booleancontainsEquivalent(Object o, EqualityComparator<Object> cmp) booleanbooleanequivalent(Object other, EqualityComparator<Object> cmp) getEquivalent(Object o, EqualityComparator<Object> cmp) protected intprotected PersistentTrieSet.AbstractSetNode<K> inthashCode()private static <K> inthashCode(PersistentTrieSet.AbstractSetNode<K> rootNode) booleanisEmpty()booleaniterator()protected Iterator<PersistentTrieSet.AbstractSetNode<K>> static final <K> Set.Immutable<K> of()static final <K> Set.Immutable<K> of(K key0) static final <K> Set.Immutable<K> of(K... keys) static final <K> Set.Immutable<K> of(K key0, K key1) voidbooleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()private static <K> intsize(PersistentTrieSet.AbstractSetNode<K> rootNode) Object[]toArray()<T> T[]toArray(T[] a) toString()static final inttransformHashCode(int hash) static final <K> Set.Transient<K> static final <K> Set.Transient<K> transientOf(K... keys) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
spliteratorMethods inherited from interface io.usethesource.capsule.Set.Immutable
intersect, subtract, union
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
EMPTY_NODE
-
EMPTY_SET
-
DEBUG
private static final boolean DEBUG- See Also:
-
rootNode
-
cachedHashCode
private final int cachedHashCode -
cachedSize
private final int cachedSize
-
-
Constructor Details
-
PersistentTrieSet
PersistentTrieSet(PersistentTrieSet.AbstractSetNode<K> rootNode, int cachedHashCode, int cachedSize)
-
-
Method Details
-
of
-
of
-
of
-
of
-
transientOf
-
transientOf
-
hashCode
-
size
-
checkHashCodeAndSize
private boolean checkHashCodeAndSize(int targetHash, int targetSize) -
transformHashCode
public static final int transformHashCode(int hash) -
contains
-
containsEquivalent
- Specified by:
containsEquivalentin interfaceSetEq<K>
-
get
-
getEquivalent
- Specified by:
getEquivalentin interfaceSetEq<K>
-
__insert
- Specified by:
__insertin interfaceSet.Immutable<K>
-
__insertEquivalent
- Specified by:
__insertEquivalentin interfaceSetEq.Immutable<K>
-
__insertAll
- Specified by:
__insertAllin interfaceSet.Immutable<K>
-
__insertAllEquivalent
- Specified by:
__insertAllEquivalentin interfaceSetEq.Immutable<K>
-
__remove
- Specified by:
__removein interfaceSet.Immutable<K>
-
__removeEquivalent
- Specified by:
__removeEquivalentin interfaceSetEq.Immutable<K>
-
__removeAll
- Specified by:
__removeAllin interfaceSet.Immutable<K>
-
__removeAllEquivalent
- Specified by:
__removeAllEquivalentin interfaceSetEq.Immutable<K>
-
__retainAll
- Specified by:
__retainAllin interfaceSet.Immutable<K>
-
__retainAllEquivalent
public Set.Immutable<K> __retainAllEquivalent(Set.Transient<? extends K> transientSet, EqualityComparator<Object> cmp) - Specified by:
__retainAllEquivalentin interfaceSetEq.Immutable<K>
-
add
-
addAll
-
clear
public void clear() -
remove
-
removeAll
-
retainAll
-
containsAll
- Specified by:
containsAllin interfaceCollection<K>- Specified by:
containsAllin interfaceSet<K>- Specified by:
containsAllin interfaceSet<K>
-
containsAllEquivalent
- Specified by:
containsAllEquivalentin interfaceSetEq<K>
-
size
public int size() -
isEmpty
public boolean isEmpty() -
iterator
-
keyIterator
- Specified by:
keyIteratorin interfaceSet<K>
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
equals
-
equivalent
- Specified by:
equivalentin interfaceSetEq<K>
-
hashCode
public int hashCode() -
toString
-
isTransientSupported
public boolean isTransientSupported()- Specified by:
isTransientSupportedin interfaceSet.Immutable<K>
-
asTransient
- Specified by:
asTransientin interfaceSet.Immutable<K>
-
getRootNode
-
nodeIterator
-
getNodeCount
protected int getNodeCount() -
arityCombinationsHistogram
protected int[][] arityCombinationsHistogram() -
arityHistogram
protected int[] arityHistogram() -
printStatistics
public void printStatistics()
-