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>
,java.lang.Iterable<K>
,java.util.Collection<K>
,java.util.Set<K>
- Direct Known Subclasses:
PersistentTrieSet.TransientTrieSet
- Enclosing class:
- PersistentTrieSet<K>
abstract static class PersistentTrieSet.AbstractTransientTrieSet<K> extends java.lang.Object implements Set.Transient<K>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PersistentTrieSet.AbstractTransientTrieSet.TransientSetKeyIterator<K>
-
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
Fields Modifier and Type Field Description protected int
cachedHashCode
protected int
cachedSize
protected PersistentTrieSet.AbstractSetNode<K>
rootNode
-
Constructor Summary
Constructors Constructor Description AbstractTransientTrieSet(PersistentTrieSet<K> trieSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
__insertAll(java.util.Set<? extends K> set)
boolean
__insertAllEquivalent(java.util.Set<? extends K> set, EqualityComparator<java.lang.Object> cmp)
protected boolean
__insertEquivalentWithCapability(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, EqualityComparator<java.lang.Object> cmp)
protected boolean
__insertWithCapability(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key)
boolean
__removeAll(java.util.Set<? extends K> set)
boolean
__removeAllEquivalent(java.util.Set<? extends K> set, EqualityComparator<java.lang.Object> cmp)
protected boolean
__removeEquivalentWithCapability(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, EqualityComparator<java.lang.Object> cmp)
protected boolean
__removeWithCapability(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key)
boolean
__retainAll(java.util.Set<? extends K> set)
boolean
__retainAllEquivalent(Set.Transient<? extends K> transientSet, EqualityComparator<java.lang.Object> cmp)
boolean
add(K key)
boolean
addAll(java.util.Collection<? extends K> c)
private boolean
checkHashCodeAndSize(int targetHash, int targetSize)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
containsAllEquivalent(java.util.Collection<?> c, EqualityComparator<java.lang.Object> cmp)
boolean
containsEquivalent(java.lang.Object o, EqualityComparator<java.lang.Object> cmp)
boolean
equals(java.lang.Object other)
boolean
equivalent(java.lang.Object other, EqualityComparator<java.lang.Object> cmp)
K
get(java.lang.Object o)
K
getEquivalent(java.lang.Object o, EqualityComparator<java.lang.Object> cmp)
int
hashCode()
boolean
isEmpty()
java.util.Iterator<K>
iterator()
java.util.Iterator<K>
keyIterator()
boolean
remove(java.lang.Object key)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.lang.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 io.usethesource.capsule.Set.Transient
__insert, __remove, freeze
-
Methods inherited from interface io.usethesource.capsule.SetEq.Transient
__insertEquivalent, __removeEquivalent
-
-
-
-
Field Detail
-
rootNode
protected PersistentTrieSet.AbstractSetNode<K> rootNode
-
cachedHashCode
protected int cachedHashCode
-
cachedSize
protected int cachedSize
-
-
Constructor Detail
-
AbstractTransientTrieSet
AbstractTransientTrieSet(PersistentTrieSet<K> trieSet)
-
-
Method Detail
-
checkHashCodeAndSize
private boolean checkHashCodeAndSize(int targetHash, int targetSize)
-
add
public boolean add(K key)
-
addAll
public boolean addAll(java.util.Collection<? extends K> c)
-
clear
public void clear()
-
remove
public boolean remove(java.lang.Object key)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
contains
public boolean contains(java.lang.Object o)
-
containsEquivalent
public boolean containsEquivalent(java.lang.Object o, EqualityComparator<java.lang.Object> cmp)
- Specified by:
containsEquivalent
in interfaceSetEq<K>
-
getEquivalent
public K getEquivalent(java.lang.Object o, EqualityComparator<java.lang.Object> cmp)
- Specified by:
getEquivalent
in interfaceSetEq<K>
-
__insertWithCapability
protected boolean __insertWithCapability(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key)
-
__insertEquivalentWithCapability
protected boolean __insertEquivalentWithCapability(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, EqualityComparator<java.lang.Object> cmp)
-
__insertAll
public boolean __insertAll(java.util.Set<? extends K> set)
- Specified by:
__insertAll
in interfaceSet.Transient<K>
-
__insertAllEquivalent
public boolean __insertAllEquivalent(java.util.Set<? extends K> set, EqualityComparator<java.lang.Object> cmp)
- Specified by:
__insertAllEquivalent
in interfaceSetEq.Transient<K>
-
__removeWithCapability
protected boolean __removeWithCapability(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key)
-
__removeEquivalentWithCapability
protected boolean __removeEquivalentWithCapability(java.util.concurrent.atomic.AtomicReference<java.lang.Thread> mutator, K key, EqualityComparator<java.lang.Object> cmp)
-
__removeAll
public boolean __removeAll(java.util.Set<? extends K> set)
- Specified by:
__removeAll
in interfaceSet.Transient<K>
-
__removeAllEquivalent
public boolean __removeAllEquivalent(java.util.Set<? extends K> set, EqualityComparator<java.lang.Object> cmp)
- Specified by:
__removeAllEquivalent
in interfaceSetEq.Transient<K>
-
__retainAll
public boolean __retainAll(java.util.Set<? extends K> set)
- Specified by:
__retainAll
in interfaceSet.Transient<K>
-
__retainAllEquivalent
public boolean __retainAllEquivalent(Set.Transient<? extends K> transientSet, EqualityComparator<java.lang.Object> cmp)
- Specified by:
__retainAllEquivalent
in interfaceSetEq.Transient<K>
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
- Specified by:
containsAll
in interfacejava.util.Collection<K>
- Specified by:
containsAll
in interfaceSet<K>
- Specified by:
containsAll
in interfacejava.util.Set<K>
-
containsAllEquivalent
public boolean containsAllEquivalent(java.util.Collection<?> c, EqualityComparator<java.lang.Object> cmp)
- Specified by:
containsAllEquivalent
in interfaceSetEq<K>
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<K> iterator()
-
keyIterator
public java.util.Iterator<K> keyIterator()
- Specified by:
keyIterator
in interfaceSet<K>
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
equals
public boolean equals(java.lang.Object other)
-
equivalent
public boolean equivalent(java.lang.Object other, EqualityComparator<java.lang.Object> cmp)
- Specified by:
equivalent
in interfaceSetEq<K>
-
-