Package pascal.taie.util.collection
Class HybridBitSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
pascal.taie.util.collection.AbstractSetEx<E>
pascal.taie.util.collection.AbstractHybridSet<E>
pascal.taie.util.collection.HybridBitSet<E>
- All Implemented Interfaces:
Serializable
,Iterable<E>
,Collection<E>
,Set<E>
,SetEx<E>
,Copyable<SetEx<E>>
Hybrid set that uses bit set for large set.
It is important to note that batch operations such as addAll(Collection)
,
removeAll(Collection)
, retainAll(Collection)
, and containsAll(Collection)
can experience performance degradation when used with IndexerBitSet
.
For example, when removing elements of a HybridBitSet
from an IndexerBitSet
(i.e., indexerBitSet.removeAll(hybridBitSet)
) or vice versa,
the operation does not take advantage of bit-level operations.
Instead, it falls back on an iterative removal process that is less efficient.
Users are advised to be aware of these potential performance implications when performing
batch operations between IndexerBitSet
and HybridBitSet
instances
to avoid unexpected inefficiencies.
- See Also:
-
Field Summary
Fields inherited from class pascal.taie.util.collection.AbstractHybridSet
isLargeSet, set, singleton
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addAll
(Collection<? extends E> c) addAllDiff
(Collection<? extends E> c) Adds all elements in collectionc
, and returns the difference set betweenc
and this set (before the call).boolean
containsAll
(Collection<?> c) copy()
Creates and returns a copy of this object.newLargeSet
(int unused) Creates a large set.boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) Methods inherited from class pascal.taie.util.collection.AbstractHybridSet
add, clear, contains, equals, getThreshold, hashCode, isEmpty, iterator, newSmallSet, remove, size, toArray, toArray
Methods inherited from class pascal.taie.util.collection.AbstractSetEx
hasOverlapWith, newSet
Methods inherited from class java.util.AbstractCollection
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
Methods inherited from interface java.util.Set
spliterator
-
Constructor Details
-
HybridBitSet
-
-
Method Details
-
newLargeSet
Description copied from class:AbstractHybridSet
Creates a large set.- Specified by:
newLargeSet
in classAbstractHybridSet<E>
- Parameters:
unused
- initial capacity of the resulting set.
-
addAll
- Specified by:
addAll
in interfaceCollection<E>
- Specified by:
addAll
in interfaceSet<E>
- Overrides:
addAll
in classAbstractHybridSet<E>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
- Overrides:
containsAll
in classAbstractHybridSet<E>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<E>
- Specified by:
removeAll
in interfaceSet<E>
- Overrides:
removeAll
in classAbstractHybridSet<E>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<E>
- Specified by:
retainAll
in interfaceSet<E>
- Overrides:
retainAll
in classAbstractHybridSet<E>
-
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>
- Overrides:
addAllDiff
in classAbstractSetEx<E>
- Returns:
- a set of elements that are contained in
c
but not in this set before the call.
-
copy
Description copied from interface:Copyable
Creates and returns a copy of this object.
-