Package pascal.taie.util.collection
Class AbstractSetEx<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
pascal.taie.util.collection.AbstractSetEx<E>
- Direct Known Subclasses:
AbstractHybridSet
,ArraySet
,GenericBitSet
,IndexableSet
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAllDiff
(Collection<? extends E> c) Adds all elements in collectionc
, and returns the difference set betweenc
and this set (before the call).copy()
Creates and returns a copy of this object.boolean
hasOverlapWith
(Set<E> other) newSet()
Creates and returns a new set.Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, iterator, remove, retainAll, size, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
AbstractSetEx
public AbstractSetEx()
-
-
Method Details
-
copy
Description copied from interface:Copyable
Creates and returns a copy of this object. -
addAllDiff
Description copied from interface:SetEx
Adds all elements in collectionc
, and returns the difference set betweenc
and this set (before the call).- Specified by:
addAllDiff
in interfaceSetEx<E>
- Returns:
- a set of elements that are contained in
c
but not in this set before the call.
-
newSet
Creates and returns a new set. The type of the new set should be the corresponding subclass. This method is provided to ease the implementation ofcopy()
andaddAllDiff(Collection)
. If a subclass overwrites above two methods, it does not need to re-implement this method. -
hasOverlapWith
- Specified by:
hasOverlapWith
in interfaceSetEx<E>
- Returns:
true
if this set has at least one element contained in the given set.
-