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, removeAll
add, addAll, clear, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, addAll, clear, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArray
parallelStream, stream
public 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 © 2024. All rights reserved.