Package com.landawn.abacus.util
Class ArrayHashSet<E>
java.lang.Object
com.landawn.abacus.util.ArrayHashSet<E>
- Type Parameters:
E
-
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
- Direct Known Subclasses:
LinkedArrayHashSet
It's designed to supported primitive/object array.
The elements in the array must not be modified after the array is added into the set.
- Since:
- 0.8
- Author:
- Haiyang Li
-
Constructor Summary
ConstructorDescriptionArrayHashSet
(int initialCapacity) ArrayHashSet
(Class<? extends Set> setType) ArrayHashSet
(Collection<? extends E> coll) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> c) Adds the all.void
clear()
Clear.boolean
boolean
containsAll
(Collection<?> c) boolean
int
hashCode()
boolean
isEmpty()
Checks if is empty.iterator()
boolean
boolean
removeAll
(Collection<?> c) Removes the all.boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) toString()
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
spliterator
-
Constructor Details
-
ArrayHashSet
public ArrayHashSet() -
ArrayHashSet
public ArrayHashSet(int initialCapacity) - Parameters:
initialCapacity
-
-
ArrayHashSet
- Parameters:
setType
-
-
ArrayHashSet
- Parameters:
coll
-
-
-
Method Details
-
add
-
addAll
Adds the all. -
remove
-
removeAll
Removes the all. -
retainAll
-
contains
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
- Parameters:
c
-- Returns:
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
size
public int size() -
isEmpty
public boolean isEmpty()Checks if is empty. -
clear
public void clear()Clear. -
hashCode
public int hashCode() -
equals
-
toString
-