Class Iterator2Collection<T>
java.lang.Object
com.ibm.wala.util.collections.Iterator2Collection<T>
- All Implemented Interfaces:
Iterable<T>, Collection<T>
- Direct Known Subclasses:
Iterator2List, Iterator2Set
Converts an
Iterator to a Collection. Note that if you just want to use Java 5's
for-each loop with an Iterator, use Iterator2Iterable.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated, for removal: This API element is subject to removal in a future version.booleanaddAll(Collection<? extends T> arg0) Deprecated, for removal: This API element is subject to removal in a future version.voidclear()Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleancontainsAll(Collection<?> arg0) Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.protected abstract Collection<T> inthashCode()Deprecated, for removal: This API element is subject to removal in a future version.booleanisEmpty()Deprecated, for removal: This API element is subject to removal in a future version.iterator()Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanremoveAll(Collection<?> arg0) Deprecated, for removal: This API element is subject to removal in a future version.booleanretainAll(Collection<?> arg0) Deprecated, for removal: This API element is subject to removal in a future version.intsize()Deprecated, for removal: This API element is subject to removal in a future version.Object[]toArray()Deprecated, for removal: This API element is subject to removal in a future version.<U> U[]toArray(U[] a) Deprecated, for removal: This API element is subject to removal in a future version.static <T> List<T> Returns aListcontaining all elements in i, preserving duplicates.static <T> Set<T> Returns aSetcontaining all elements in i.toString()Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from interface Collection
parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
Iterator2Collection
public Iterator2Collection()
-
-
Method Details
-
getDelegate
-
toSet
Returns aSetcontaining all elements in i. Note that duplicates will be removed.- Throws:
IllegalArgumentException
-
toList
Returns aListcontaining all elements in i, preserving duplicates.- Throws:
IllegalArgumentException
-
toString
Deprecated, for removal: This API element is subject to removal in a future version. -
size
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
sizein interfaceCollection<T>
-
clear
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
clearin interfaceCollection<T>
-
isEmpty
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
isEmptyin interfaceCollection<T>
-
toArray
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
toArrayin interfaceCollection<T>
-
add
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
addin interfaceCollection<T>
-
contains
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
containsin interfaceCollection<T>
-
remove
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
removein interfaceCollection<T>
-
addAll
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
addAllin interfaceCollection<T>
-
containsAll
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
containsAllin interfaceCollection<T>
-
removeAll
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
removeAllin interfaceCollection<T>
-
retainAll
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
retainAllin interfaceCollection<T>
-
iterator
Deprecated, for removal: This API element is subject to removal in a future version. -
toArray
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
toArrayin interfaceCollection<T>
-
equals
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
equalsin interfaceCollection<T>- Overrides:
equalsin classObject
-
hashCode
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
hashCodein interfaceCollection<T>- Overrides:
hashCodein classObject
-