E
- element type.public class HashSet<E> extends AbstractSet<E> implements Set<E>, Cloneable, Serializable
Modifier | Constructor and Description |
---|---|
|
HashSet() |
|
HashSet(Collection<? extends E> c) |
protected |
HashSet(HashMap<E,Object> map)
Protected constructor to specify the underlying map.
|
|
HashSet(int initialCapacity) |
|
HashSet(int initialCapacity,
float loadFactor) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E o) |
void |
clear() |
Object |
clone() |
boolean |
contains(Object o) |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
boolean |
remove(Object o) |
int |
size() |
equals, hashCode, removeAll
addAll, containsAll, retainAll, toArray, toArray, toString
spliterator
addAll, containsAll, parallelStream, removeAll, removeIf, retainAll, stream, toArray, toArray
public HashSet()
public HashSet(Collection<? extends E> c)
public HashSet(int initialCapacity)
public HashSet(int initialCapacity, float loadFactor)
public boolean add(E o)
add
in interface Collection<E>
add
in class AbstractCollection<E>
public void clear()
clear
in interface Collection<E>
clear
in class AbstractCollection<E>
public Object clone()
public boolean contains(Object o)
contains
in interface Collection<E>
contains
in class AbstractCollection<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in class AbstractCollection<E>
public boolean remove(Object o)
remove
in interface Collection<E>
remove
in class AbstractCollection<E>
public int size()
size
in interface Collection<E>
Copyright © 2018. All rights reserved.