@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() |
Iterator<E> |
iterator() |
static <E> SingletonSet<E> |
of(E element) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
public static <E> SingletonSet<E> of(@Nonnull E element)
public abstract E getElement()
public final int size()
public final boolean isEmpty()
public final 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 © 2017 OpenDaylight. All rights reserved.