public class SingletonSet<E> extends AbstractSet<E> implements Serializable
| Constructor and Description |
|---|
SingletonSet(E obj) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Object obj) |
static <E> SingletonSet<E> |
create(E obj) |
void |
forEach(Consumer<? super E> action) |
E |
get() |
Iterator<E> |
iterator() |
boolean |
removeIf(Predicate<? super E> filter) |
int |
size() |
equals, hashCode, removeAlladd, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArrayparallelStream, streampublic SingletonSet(E obj)
public static <E> SingletonSet<E> create(E obj)
public int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>public boolean contains(Object obj)
contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>public E get()
public boolean removeIf(Predicate<? super E> filter)
removeIf in interface Collection<E>Copyright © 2025. All rights reserved.