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 class
Iterator skeleton that uses a fixed stack in depth.protected static class
(package private) static class
private static final class
protected static class
protected static class
private static final class
protected static class
(package private) static final class
private static class
Iterator 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 int
private final int
private static final boolean
private static final PersistentTrieSet.CompactSetNode
private static final PersistentTrieSet
private 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) boolean
boolean
addAll
(Collection<? extends K> c) protected int[][]
protected int[]
private boolean
checkHashCodeAndSize
(int targetHash, int targetSize) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
containsAllEquivalent
(Collection<?> c, EqualityComparator<Object> cmp) boolean
containsEquivalent
(Object o, EqualityComparator<Object> cmp) boolean
boolean
equivalent
(Object other, EqualityComparator<Object> cmp) getEquivalent
(Object o, EqualityComparator<Object> cmp) protected int
protected PersistentTrieSet.AbstractSetNode
<K> int
hashCode()
private static <K> int
hashCode
(PersistentTrieSet.AbstractSetNode<K> rootNode) boolean
isEmpty()
boolean
iterator()
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) void
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
private static <K> int
size
(PersistentTrieSet.AbstractSetNode<K> rootNode) Object[]
toArray()
<T> T[]
toArray
(T[] a) toString()
static final int
transformHashCode
(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, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
spliterator
Methods 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:
containsEquivalent
in interfaceSetEq<K>
-
get
-
getEquivalent
- Specified by:
getEquivalent
in interfaceSetEq<K>
-
__insert
- Specified by:
__insert
in interfaceSet.Immutable<K>
-
__insertEquivalent
- Specified by:
__insertEquivalent
in interfaceSetEq.Immutable<K>
-
__insertAll
- Specified by:
__insertAll
in interfaceSet.Immutable<K>
-
__insertAllEquivalent
- Specified by:
__insertAllEquivalent
in interfaceSetEq.Immutable<K>
-
__remove
- Specified by:
__remove
in interfaceSet.Immutable<K>
-
__removeEquivalent
- Specified by:
__removeEquivalent
in interfaceSetEq.Immutable<K>
-
__removeAll
- Specified by:
__removeAll
in interfaceSet.Immutable<K>
-
__removeAllEquivalent
- Specified by:
__removeAllEquivalent
in interfaceSetEq.Immutable<K>
-
__retainAll
- Specified by:
__retainAll
in interfaceSet.Immutable<K>
-
__retainAllEquivalent
public Set.Immutable<K> __retainAllEquivalent(Set.Transient<? extends K> transientSet, EqualityComparator<Object> cmp) - Specified by:
__retainAllEquivalent
in interfaceSetEq.Immutable<K>
-
add
-
addAll
-
clear
public void clear() -
remove
-
removeAll
-
retainAll
-
containsAll
- Specified by:
containsAll
in interfaceCollection<K>
- Specified by:
containsAll
in interfaceSet<K>
- Specified by:
containsAll
in interfaceSet<K>
-
containsAllEquivalent
- Specified by:
containsAllEquivalent
in interfaceSetEq<K>
-
size
public int size() -
isEmpty
public boolean isEmpty() -
iterator
-
keyIterator
- Specified by:
keyIterator
in interfaceSet<K>
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
equals
-
equivalent
- Specified by:
equivalent
in interfaceSetEq<K>
-
hashCode
public int hashCode() -
toString
-
isTransientSupported
public boolean isTransientSupported()- Specified by:
isTransientSupported
in interfaceSet.Immutable<K>
-
asTransient
- Specified by:
asTransient
in interfaceSet.Immutable<K>
-
getRootNode
-
nodeIterator
-
getNodeCount
protected int getNodeCount() -
arityCombinationsHistogram
protected int[][] arityCombinationsHistogram() -
arityHistogram
protected int[] arityHistogram() -
printStatistics
public void printStatistics()
-