Class MapBackedSet<E,V>
- java.lang.Object
-
- org.apache.openjpa.lib.util.collections.MapBackedSet<E,V>
-
- All Implemented Interfaces:
Serializable,Iterable<E>,Collection<E>,Set<E>
public final class MapBackedSet<E,V> extends Object implements Set<E>, Serializable
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E obj)booleanaddAll(Collection<? extends E> coll)voidclear()booleancontains(Object obj)booleancontainsAll(Collection<?> coll)booleanequals(Object obj)inthashCode()booleanisEmpty()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.booleanremove(Object obj)booleanremoveAll(Collection<?> coll)booleanremoveIf(Predicate<? super E> filter)booleanretainAll(Collection<?> coll)intsize()Object[]toArray()<T> T[]toArray(T[] array)-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
-
Methods inherited from interface java.util.Set
spliterator
-
-
-
-
Method Detail
-
mapBackedSet
public static <E,V> MapBackedSet<E,V> mapBackedSet(Map<E,? super V> map)
Factory method to create a set from a map.- Type Parameters:
E- the element typeV- the dummy value type in the map- Parameters:
map- the map to decorate, must not be null- Returns:
- a new map backed set
- Throws:
NullPointerException- if map is null- Since:
- 4.0
-
mapBackedSet
public static <E,V> MapBackedSet<E,V> mapBackedSet(Map<E,? super V> map, V dummyValue)
Factory method to create a set from a map.- Type Parameters:
E- the element typeV- the dummy value type in the map- Parameters:
map- the map to decorate, must not be nulldummyValue- the dummy value to use- Returns:
- a new map backed set
- Throws:
NullPointerException- if map is null- Since:
- 4.0
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object obj)
-
containsAll
public boolean containsAll(Collection<?> coll)
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
add
public boolean add(E obj)
-
addAll
public boolean addAll(Collection<? extends E> coll)
-
remove
public boolean remove(Object obj)
-
removeIf
public boolean removeIf(Predicate<? super E> filter)
- Specified by:
removeIfin interfaceCollection<E>- Since:
- 4.4
-
removeAll
public boolean removeAll(Collection<?> coll)
-
retainAll
public boolean retainAll(Collection<?> coll)
-
clear
public void clear()
-
toArray
public Object[] toArray()
-
toArray
public <T> T[] toArray(T[] array)
-
equals
public boolean equals(Object obj)
-
-