Class MapBackedSet
- java.lang.Object
-
- org.apache.commons.collections.set.MapBackedSet
-
- All Implemented Interfaces:
Serializable,Iterable,Collection,Set
@Deprecated(since="2021-04-30") public final class MapBackedSet extends Object implements Set, Serializable
Deprecated.Commons Collections 3 is in maintenance mode. Commons Collections 4 should be used instead.Decorates aMapto obtainSetbehaviour.This class is used to create a
Setwith the same properties as the key set of any map. Thus, a ReferenceSet can be created by wrapping aReferenceMapin an instance of this class.Most map implementation can be used to create a set by passing in dummy values. Exceptions include
BidiMapimplementations, as they require unique values.- Since:
- Commons Collections 3.1
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(Object obj)Deprecated.booleanaddAll(Collection coll)Deprecated.voidclear()Deprecated.booleancontains(Object obj)Deprecated.booleancontainsAll(Collection coll)Deprecated.static Setdecorate(Map map)Deprecated.Factory method to create a set from a map.static Setdecorate(Map map, Object dummyValue)Deprecated.Factory method to create a set from a map.booleanequals(Object obj)Deprecated.inthashCode()Deprecated.booleanisEmpty()Deprecated.Iteratoriterator()Deprecated.booleanremove(Object obj)Deprecated.booleanremoveAll(Collection coll)Deprecated.booleanretainAll(Collection coll)Deprecated.intsize()Deprecated.Object[]toArray()Deprecated.Object[]toArray(Object[] array)Deprecated.-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
spliterator
-
-
-
-
Method Detail
-
decorate
public static Set decorate(Map map)
Deprecated.Factory method to create a set from a map.- Parameters:
map- the map to decorate, must not be null- Throws:
IllegalArgumentException- if set is null
-
decorate
public static Set decorate(Map map, Object dummyValue)
Deprecated.Factory method to create a set from a map.- Parameters:
map- the map to decorate, must not be nulldummyValue- the dummy value to use- Throws:
IllegalArgumentException- if map is null
-
size
public int size()
Deprecated.- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceSet
-
isEmpty
public boolean isEmpty()
Deprecated.- Specified by:
isEmptyin interfaceCollection- Specified by:
isEmptyin interfaceSet
-
iterator
public Iterator iterator()
Deprecated.
-
contains
public boolean contains(Object obj)
Deprecated.- Specified by:
containsin interfaceCollection- Specified by:
containsin interfaceSet
-
containsAll
public boolean containsAll(Collection coll)
Deprecated.- Specified by:
containsAllin interfaceCollection- Specified by:
containsAllin interfaceSet
-
add
public boolean add(Object obj)
Deprecated.- Specified by:
addin interfaceCollection- Specified by:
addin interfaceSet
-
addAll
public boolean addAll(Collection coll)
Deprecated.- Specified by:
addAllin interfaceCollection- Specified by:
addAllin interfaceSet
-
remove
public boolean remove(Object obj)
Deprecated.- Specified by:
removein interfaceCollection- Specified by:
removein interfaceSet
-
removeAll
public boolean removeAll(Collection coll)
Deprecated.- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceSet
-
retainAll
public boolean retainAll(Collection coll)
Deprecated.- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceSet
-
clear
public void clear()
Deprecated.- Specified by:
clearin interfaceCollection- Specified by:
clearin interfaceSet
-
toArray
public Object[] toArray()
Deprecated.- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceSet
-
toArray
public Object[] toArray(Object[] array)
Deprecated.- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceSet
-
equals
public boolean equals(Object obj)
Deprecated.
-
-