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() |
String |
toString() |
equals, hashCode, removeAll
addAll, containsAll, retainAll, 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 interface Set<E>
add
in class AbstractCollection<E>
public void clear()
clear
in interface Collection<E>
clear
in interface Set<E>
clear
in class AbstractCollection<E>
public Object clone()
public boolean contains(Object o)
contains
in interface Collection<E>
contains
in interface Set<E>
contains
in class AbstractCollection<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in interface Set<E>
isEmpty
in class AbstractCollection<E>
public boolean remove(Object o)
remove
in interface Collection<E>
remove
in interface Set<E>
remove
in class AbstractCollection<E>
public int size()
size
in interface Collection<E>
size
in interface Set<E>
size
in class AbstractCollection<E>
public String toString()
toString
in class AbstractCollection<E>
Copyright © 2018. All rights reserved.