public class BasedHashSet<E> extends Object implements Set<E>
Constructor and Description |
---|
BasedHashSet(Map<E,Object> map)
Constructs a new, empty set; the backing HashMap instance has default initial
capacity (16) and load factor (0.75).
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E o)
Adds the specified element to this set if it is not already present.
|
boolean |
addAll(Collection<? extends E> c) |
void |
clear()
Removes all of the elements from this set.
|
boolean |
contains(Object o)
Returns true if this set contains the specified element.
|
boolean |
containsAll(Collection<?> c) |
boolean |
isEmpty()
Returns true if this set contains no elements.
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this set.
|
boolean |
remove(Object o)
Removes the specified element from this set if it is present.
|
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size()
Returns the number of elements in this set (its cardinality).
|
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode, spliterator
parallelStream, removeIf, stream
public Iterator<E> iterator()
public int size()
public boolean isEmpty()
public boolean contains(Object o)
public boolean add(E o)
public boolean remove(Object o)
public void clear()
public boolean addAll(Collection<? extends E> c)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public Object[] toArray()
public <T> T[] toArray(T[] a)
Copyright © GigaSpaces.