Class MapBackedSet
- java.lang.Object
-
- org.apache.commons.collections.set.MapBackedSet
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Iterable,java.util.Collection,java.util.Set
@Deprecated(since="2021-04-30") public final class MapBackedSet extends java.lang.Object implements java.util.Set, java.io.SerializableDeprecated.Apache Commons Collections version 3.x is being deprecated from AEMaaCS. The upgraded version 4.4 of Commons Collections is already included as replacement. Customers are advised to upgrade to this version of the library. Please note: the package name was changed to org.apache.commons.collections4. Further note that there are AEM APIs currently exposing the old collections classes; these will be updated in upcoming releases.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(java.lang.Object obj)Deprecated.booleanaddAll(java.util.Collection coll)Deprecated.voidclear()Deprecated.booleancontains(java.lang.Object obj)Deprecated.booleancontainsAll(java.util.Collection coll)Deprecated.static java.util.Setdecorate(java.util.Map map)Deprecated.Factory method to create a set from a map.static java.util.Setdecorate(java.util.Map map, java.lang.Object dummyValue)Deprecated.Factory method to create a set from a map.booleanequals(java.lang.Object obj)Deprecated.inthashCode()Deprecated.booleanisEmpty()Deprecated.java.util.Iteratoriterator()Deprecated.booleanremove(java.lang.Object obj)Deprecated.booleanremoveAll(java.util.Collection coll)Deprecated.booleanretainAll(java.util.Collection coll)Deprecated.intsize()Deprecated.java.lang.Object[]toArray()Deprecated.java.lang.Object[]toArray(java.lang.Object[] array)Deprecated.
-
-
-
Method Detail
-
decorate
public static java.util.Set decorate(java.util.Map map)
Deprecated.Factory method to create a set from a map.- Parameters:
map- the map to decorate, must not be null- Throws:
java.lang.IllegalArgumentException- if set is null
-
decorate
public static java.util.Set decorate(java.util.Map map, java.lang.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:
java.lang.IllegalArgumentException- if map is null
-
size
public int size()
Deprecated.- Specified by:
sizein interfacejava.util.Collection- Specified by:
sizein interfacejava.util.Set
-
isEmpty
public boolean isEmpty()
Deprecated.- Specified by:
isEmptyin interfacejava.util.Collection- Specified by:
isEmptyin interfacejava.util.Set
-
iterator
public java.util.Iterator iterator()
Deprecated.- Specified by:
iteratorin interfacejava.util.Collection- Specified by:
iteratorin interfacejava.lang.Iterable- Specified by:
iteratorin interfacejava.util.Set
-
contains
public boolean contains(java.lang.Object obj)
Deprecated.- Specified by:
containsin interfacejava.util.Collection- Specified by:
containsin interfacejava.util.Set
-
containsAll
public boolean containsAll(java.util.Collection coll)
Deprecated.- Specified by:
containsAllin interfacejava.util.Collection- Specified by:
containsAllin interfacejava.util.Set
-
add
public boolean add(java.lang.Object obj)
Deprecated.- Specified by:
addin interfacejava.util.Collection- Specified by:
addin interfacejava.util.Set
-
addAll
public boolean addAll(java.util.Collection coll)
Deprecated.- Specified by:
addAllin interfacejava.util.Collection- Specified by:
addAllin interfacejava.util.Set
-
remove
public boolean remove(java.lang.Object obj)
Deprecated.- Specified by:
removein interfacejava.util.Collection- Specified by:
removein interfacejava.util.Set
-
removeAll
public boolean removeAll(java.util.Collection coll)
Deprecated.- Specified by:
removeAllin interfacejava.util.Collection- Specified by:
removeAllin interfacejava.util.Set
-
retainAll
public boolean retainAll(java.util.Collection coll)
Deprecated.- Specified by:
retainAllin interfacejava.util.Collection- Specified by:
retainAllin interfacejava.util.Set
-
clear
public void clear()
Deprecated.- Specified by:
clearin interfacejava.util.Collection- Specified by:
clearin interfacejava.util.Set
-
toArray
public java.lang.Object[] toArray()
Deprecated.- Specified by:
toArrayin interfacejava.util.Collection- Specified by:
toArrayin interfacejava.util.Set
-
toArray
public java.lang.Object[] toArray(java.lang.Object[] array)
Deprecated.- Specified by:
toArrayin interfacejava.util.Collection- Specified by:
toArrayin interfacejava.util.Set
-
equals
public boolean equals(java.lang.Object obj)
Deprecated.- Specified by:
equalsin interfacejava.util.Collection- Specified by:
equalsin interfacejava.util.Set- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Deprecated.- Specified by:
hashCodein interfacejava.util.Collection- Specified by:
hashCodein interfacejava.util.Set- Overrides:
hashCodein classjava.lang.Object
-
-