@Beta public abstract class SingletonSet<E> extends Object implements Set<E>, Immutable, Serializable
Set
containing a single value. For some reason neither Java nor Guava provide direct access to the retained
element -- which is desirable in some situations, as is the case in SharedSingletonMap.entrySet()
.Constructor and Description |
---|
SingletonSet() |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e) |
boolean |
addAll(Collection<? extends E> c) |
void |
clear() |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object obj) |
abstract E |
getElement() |
abstract int |
hashCode() |
boolean |
isEmpty() |
@NonNull Iterator<E> |
iterator() |
static <E> @NonNull SingletonSet<E> |
of(E element) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
abstract @NonNull Spliterator<E> |
spliterator() |
@NonNull Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
parallelStream, removeIf, stream
public static <E> @NonNull SingletonSet<E> of(E element)
public abstract E getElement()
public final int size()
public final boolean isEmpty()
public abstract @NonNull Spliterator<E> spliterator()
spliterator
in interface Iterable<E>
spliterator
in interface Collection<E>
spliterator
in interface Set<E>
public final @NonNull Object[] toArray()
public final <T> T[] toArray(T[] a)
public final boolean add(E e)
public final boolean remove(Object o)
public final boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
public final boolean addAll(Collection<? extends E> c)
public final boolean retainAll(Collection<?> c)
public final boolean removeAll(Collection<?> c)
public final void clear()
public abstract int hashCode()
Copyright © 2019 OpenDaylight. All rights reserved.