Class SetFromCollectionUnsafe<T>
java.lang.Object
java.util.AbstractCollection<T>
java.util.AbstractSet<T>
org.aksw.commons.collections.sets.SetFromCollectionUnsafe<T>
- All Implemented Interfaces:
Iterable<T>, Collection<T>, Set<T>
In contrast to
SetFromCollection, the unsafe version
does not handle duplicates in the backend collection.
Only use the unsafe version if the uniqueness of items in the backend is ensured.
This class simply delegates calls to iterator() and size() to the backend.- Author:
- raven
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractSet
equals, hashCode, removeAllMethods inherited from class AbstractCollection
addAll, containsAll, isEmpty, retainAll, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface Set
addAll, containsAll, isEmpty, retainAll, spliterator, toArray, toArray
-
Field Details
-
backend
-
-
Constructor Details
-
SetFromCollectionUnsafe
-
-
Method Details
-
add
- Specified by:
addin interfaceCollection<T>- Specified by:
addin interfaceSet<T>- Overrides:
addin classAbstractCollection<T>
-
remove
This method removes ALL occurrences of a given item. The backend MUST adhere to the contract that remove() returns false once there is no more change - otherwise calling this method will cause an endless loop.- Specified by:
removein interfaceCollection<T>- Specified by:
removein interfaceSet<T>- Overrides:
removein classAbstractCollection<T>
-
contains
- Specified by:
containsin interfaceCollection<T>- Specified by:
containsin interfaceSet<T>- Overrides:
containsin classAbstractCollection<T>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T>- Specified by:
clearin interfaceSet<T>- Overrides:
clearin classAbstractCollection<T>
-
iterator
-
size
public int size()- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceSet<T>- Specified by:
sizein classAbstractCollection<T>
-
wrapIfNeeded
-