Package io.usethesource.capsule.core
Class PersistentTrieSet.AbstractTransientTrieSet<K>
java.lang.Object
io.usethesource.capsule.core.PersistentTrieSet.AbstractTransientTrieSet<K>
- All Implemented Interfaces:
Set<K>
,Set.Transient<K>
,SetEq<K>
,SetEq.Transient<K>
,Iterable<K>
,Collection<K>
,Set<K>
- Direct Known Subclasses:
PersistentTrieSet.TransientTrieSet
- Enclosing class:
PersistentTrieSet<K>
abstract static class PersistentTrieSet.AbstractTransientTrieSet<K>
extends Object
implements Set.Transient<K>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
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 TypeFieldDescriptionprotected int
protected int
protected PersistentTrieSet.AbstractSetNode
<K> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
__insertAll
(Set<? extends K> set) boolean
__insertAllEquivalent
(Set<? extends K> set, EqualityComparator<Object> cmp) protected boolean
__insertEquivalentWithCapability
(AtomicReference<Thread> mutator, K key, EqualityComparator<Object> cmp) protected boolean
__insertWithCapability
(AtomicReference<Thread> mutator, K key) boolean
__removeAll
(Set<? extends K> set) boolean
__removeAllEquivalent
(Set<? extends K> set, EqualityComparator<Object> cmp) protected boolean
__removeEquivalentWithCapability
(AtomicReference<Thread> mutator, K key, EqualityComparator<Object> cmp) protected boolean
__removeWithCapability
(AtomicReference<Thread> mutator, K key) boolean
__retainAll
(Set<? extends K> set) boolean
__retainAllEquivalent
(Set.Transient<? extends K> transientSet, EqualityComparator<Object> cmp) boolean
boolean
addAll
(Collection<? extends K> c) 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) int
hashCode()
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, 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.Transient
__insert, __remove, freeze
Methods inherited from interface io.usethesource.capsule.SetEq.Transient
__insertEquivalent, __removeEquivalent
-
Field Details
-
rootNode
-
cachedHashCode
protected int cachedHashCode -
cachedSize
protected int cachedSize
-
-
Constructor Details
-
AbstractTransientTrieSet
AbstractTransientTrieSet(PersistentTrieSet<K> trieSet)
-
-
Method Details
-
checkHashCodeAndSize
private boolean checkHashCodeAndSize(int targetHash, int targetSize) -
add
-
addAll
-
clear
public void clear() -
remove
-
removeAll
-
retainAll
-
contains
-
containsEquivalent
- Specified by:
containsEquivalent
in interfaceSetEq<K>
-
get
-
getEquivalent
- Specified by:
getEquivalent
in interfaceSetEq<K>
-
__insertWithCapability
-
__insertEquivalentWithCapability
protected boolean __insertEquivalentWithCapability(AtomicReference<Thread> mutator, K key, EqualityComparator<Object> cmp) -
__insertAll
- Specified by:
__insertAll
in interfaceSet.Transient<K>
-
__insertAllEquivalent
- Specified by:
__insertAllEquivalent
in interfaceSetEq.Transient<K>
-
__removeWithCapability
-
__removeEquivalentWithCapability
protected boolean __removeEquivalentWithCapability(AtomicReference<Thread> mutator, K key, EqualityComparator<Object> cmp) -
__removeAll
- Specified by:
__removeAll
in interfaceSet.Transient<K>
-
__removeAllEquivalent
- Specified by:
__removeAllEquivalent
in interfaceSetEq.Transient<K>
-
__retainAll
- Specified by:
__retainAll
in interfaceSet.Transient<K>
-
__retainAllEquivalent
public boolean __retainAllEquivalent(Set.Transient<? extends K> transientSet, EqualityComparator<Object> cmp) - Specified by:
__retainAllEquivalent
in interfaceSetEq.Transient<K>
-
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()
-