Package org.kingdoms.utils.internal
Class QuantumHashSet<K>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<K>
org.kingdoms.utils.internal.QuantumHashSet<K>
- All Implemented Interfaces:
Cloneable,Iterable<K>,Collection<K>,Set<K>
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty HashMap with the default initial capacity (16) and the default load factor (0.75).QuantumHashSet(int initialCapacity) Constructs an empty HashMap with the specified initial capacity and the default load factor (0.75).QuantumHashSet(int initialCapacity, float loadFactor) Constructs an empty HashMap with the specified initial capacity and load factor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(@NonNull Collection<? extends K> c) voidclear()Removes all of the mappings from this map.booleanbooleancontainsAll(@NonNull Collection<?> c) voidstatic intbooleanisEmpty()iterator()org.kingdoms.utils.internal.QuantumHashSet.Node<K>org.kingdoms.utils.internal.QuantumHashSet.TreeNode<K>newTreeNode(int hash, K key, org.kingdoms.utils.internal.QuantumHashSet.Node<K> next) final booleanImplements Map.put and related methodsbooleanbooleanremoveAll(@NonNull Collection<?> c) org.kingdoms.utils.internal.QuantumHashSet.Node<K>replacementNode(org.kingdoms.utils.internal.QuantumHashSet.Node<K> p, org.kingdoms.utils.internal.QuantumHashSet.Node<K> next) org.kingdoms.utils.internal.QuantumHashSet.TreeNode<K>replacementTreeNode(org.kingdoms.utils.internal.QuantumHashSet.Node<K> p, org.kingdoms.utils.internal.QuantumHashSet.Node<K> next) booleanretainAll(@NonNull Collection<?> c) intsize()final Spliterator<K>Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class java.util.AbstractSet
equals, hashCodeMethods inherited from class java.util.AbstractCollection
toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
QuantumHashSet
public QuantumHashSet(int initialCapacity, float loadFactor) Constructs an empty HashMap with the specified initial capacity and load factor.- Parameters:
initialCapacity- the initial capacityloadFactor- the load factor- Throws:
IllegalArgumentException- if the initial capacity is negative or the load factor is nonpositive
-
QuantumHashSet
public QuantumHashSet(int initialCapacity) Constructs an empty HashMap with the specified initial capacity and the default load factor (0.75).- Parameters:
initialCapacity- the initial capacity.- Throws:
IllegalArgumentException- if the initial capacity is negative.
-
QuantumHashSet
public QuantumHashSet()Constructs an empty HashMap with the default initial capacity (16) and the default load factor (0.75).
-
-
Method Details
-
hash
-
size
public int size()- Specified by:
sizein interfaceCollection<K>- Specified by:
sizein interfaceSet<K>- Specified by:
sizein classAbstractCollection<K>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<K>- Specified by:
isEmptyin interfaceSet<K>- Overrides:
isEmptyin classAbstractCollection<K>
-
contains
- Specified by:
containsin interfaceCollection<K>- Specified by:
containsin interfaceSet<K>- Overrides:
containsin classAbstractCollection<K>
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection<K>- Specified by:
toArrayin interfaceSet<K>- Overrides:
toArrayin classAbstractCollection<K>
-
toArray
public <T> T[] toArray(T[] a) - Specified by:
toArrayin interfaceCollection<K>- Specified by:
toArrayin interfaceSet<K>- Overrides:
toArrayin classAbstractCollection<K>
-
add
- Specified by:
addin interfaceCollection<K>- Specified by:
addin interfaceSet<K>- Overrides:
addin classAbstractCollection<K>
-
putVal
Implements Map.put and related methods- Parameters:
hash- hash for keykey- the key- Returns:
- previous value, or null if none
-
remove
- Specified by:
removein interfaceCollection<K>- Specified by:
removein interfaceSet<K>- Overrides:
removein classAbstractCollection<K>
-
containsAll
- Specified by:
containsAllin interfaceCollection<K>- Specified by:
containsAllin interfaceSet<K>- Overrides:
containsAllin classAbstractCollection<K>
-
addAll
- Specified by:
addAllin interfaceCollection<K>- Specified by:
addAllin interfaceSet<K>- Overrides:
addAllin classAbstractCollection<K>
-
retainAll
- Specified by:
retainAllin interfaceCollection<K>- Specified by:
retainAllin interfaceSet<K>- Overrides:
retainAllin classAbstractCollection<K>
-
removeAll
- Specified by:
removeAllin interfaceCollection<K>- Specified by:
removeAllin interfaceSet<K>- Overrides:
removeAllin classAbstractSet<K>
-
clear
public void clear()Removes all of the mappings from this map. The map will be empty after this call returns.- Specified by:
clearin interfaceCollection<K>- Specified by:
clearin interfaceSet<K>- Overrides:
clearin classAbstractCollection<K>
-
spliterator
- Specified by:
spliteratorin interfaceCollection<K>- Specified by:
spliteratorin interfaceIterable<K>- Specified by:
spliteratorin interfaceSet<K>
-
forEach
-
newNode
-
replacementNode
-
newTreeNode
-
replacementTreeNode
-