public final class MapBackedSet<E,V> extends Object implements Set<E>, Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
add(E obj) |
boolean |
addAll(Collection<? extends E> coll) |
void |
clear() |
boolean |
contains(Object obj) |
boolean |
containsAll(Collection<?> coll) |
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
static <E,V> MapBackedSet<E,V> |
mapBackedSet(Map<E,? super V> map)
Factory method to create a set from a map.
|
static <E,V> MapBackedSet<E,V> |
mapBackedSet(Map<E,? super V> map,
V dummyValue)
Factory method to create a set from a map.
|
boolean |
remove(Object obj) |
boolean |
removeAll(Collection<?> coll) |
boolean |
removeIf(Predicate<? super E> filter) |
boolean |
retainAll(Collection<?> coll) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
spliterator
parallelStream, stream
public static <E,V> MapBackedSet<E,V> mapBackedSet(Map<E,? super V> map)
E
- the element typeV
- the dummy value type in the mapmap
- the map to decorate, must not be nullNullPointerException
- if map is nullpublic static <E,V> MapBackedSet<E,V> mapBackedSet(Map<E,? super V> map, V dummyValue)
E
- the element typeV
- the dummy value type in the mapmap
- the map to decorate, must not be nulldummyValue
- the dummy value to useNullPointerException
- if map is nullpublic int size()
public boolean isEmpty()
public boolean contains(Object obj)
public boolean containsAll(Collection<?> coll)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
public boolean add(E obj)
public boolean addAll(Collection<? extends E> coll)
public boolean remove(Object obj)
public boolean removeIf(Predicate<? super E> filter)
removeIf
in interface Collection<E>
public boolean removeAll(Collection<?> coll)
public boolean retainAll(Collection<?> coll)
public void clear()
public Object[] toArray()
public <T> T[] toArray(T[] array)
public boolean equals(Object obj)
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.