Class MapBackedSet<E,V>
- java.lang.Object
-
- org.apache.openjpa.lib.util.collections.MapBackedSet<E,V>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
public final class MapBackedSet<E,V> extends java.lang.Object implements java.util.Set<E>, java.io.Serializable
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E obj)
boolean
addAll(java.util.Collection<? extends E> coll)
void
clear()
boolean
contains(java.lang.Object obj)
boolean
containsAll(java.util.Collection<?> coll)
boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
isEmpty()
java.util.Iterator<E>
iterator()
static <E,V>
MapBackedSet<E,V>mapBackedSet(java.util.Map<E,? super V> map)
Factory method to create a set from a map.static <E,V>
MapBackedSet<E,V>mapBackedSet(java.util.Map<E,? super V> map, V dummyValue)
Factory method to create a set from a map.boolean
remove(java.lang.Object obj)
boolean
removeAll(java.util.Collection<?> coll)
boolean
removeIf(java.util.function.Predicate<? super E> filter)
boolean
retainAll(java.util.Collection<?> coll)
int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] array)
-
-
-
Method Detail
-
mapBackedSet
public static <E,V> MapBackedSet<E,V> mapBackedSet(java.util.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:
java.lang.NullPointerException
- if map is null- Since:
- 4.0
-
mapBackedSet
public static <E,V> MapBackedSet<E,V> mapBackedSet(java.util.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:
java.lang.NullPointerException
- if map is null- Since:
- 4.0
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<E> iterator()
-
contains
public boolean contains(java.lang.Object obj)
-
containsAll
public boolean containsAll(java.util.Collection<?> coll)
-
add
public boolean add(E obj)
-
addAll
public boolean addAll(java.util.Collection<? extends E> coll)
-
remove
public boolean remove(java.lang.Object obj)
-
removeIf
public boolean removeIf(java.util.function.Predicate<? super E> filter)
- Specified by:
removeIf
in interfacejava.util.Collection<E>
- Since:
- 4.4
-
removeAll
public boolean removeAll(java.util.Collection<?> coll)
-
retainAll
public boolean retainAll(java.util.Collection<?> coll)
-
clear
public void clear()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] array)
-
equals
public boolean equals(java.lang.Object obj)
-
-