public class HashSet<E> extends AbstractSet<E>
HashSet is an implementation of Set backed by a HashMap.| Modifier and Type | Method and Description |
|---|---|
HashSet<E> |
add(E value)
Returns a set that adds the specified value if it doesn't already exist in this set.
|
boolean |
contains(E value)
Returns true if the value exists in this set.
|
static <E> HashSet<E> |
empty() |
static <E> BuilderFactory<E,HashSet<E>> |
factory() |
<U> void |
forEach(Function<E,U> f)
All collection methods can be built upon this
forEach definition. |
java.util.Iterator<E> |
iterator() |
HashSet<E> |
remove(E value)
Removes the specified value from the set if it exists.
|
int |
size()
Returns the size of the collection.
|
asSet, equals, hashCodeisEmpty, makeString, makeString, to, toArray, toArray, toIndexedList, toSet, toSortedSet, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitisEmpty, makeString, makeString, to, toArray, toArray, toIndexedList, toSet, toSortedSet@NotNull public static <E> BuilderFactory<E,HashSet<E>> factory()
@NotNull public static <E> HashSet<E> empty()
@NotNull public HashSet<E> add(E value)
Set@NotNull public HashSet<E> remove(E value)
Setpublic boolean contains(E value)
Setpublic int size()
TraversableWarning: infinite collections are possible, as are collections that require traversal to calculate the size.
size in interface Traversable<E>size in class AbstractTraversable<E>public <U> void forEach(@NotNull
Function<E,U> f)
TraversableforEach definition.forEach in interface Traversable<E>forEach in class AbstractIterable<E>@NotNull public java.util.Iterator<E> iterator()