Package pascal.taie.util.collection
Class IndexerBitSet<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
pascal.taie.util.collection.AbstractSetEx<E>
pascal.taie.util.collection.GenericBitSet<E>
pascal.taie.util.collection.IndexerBitSet<E>
- Type Parameters:
E
- type of elements
- All Implemented Interfaces:
Serializable
,Iterable<E>
,Collection<E>
,Set<E>
,SetEx<E>
,Copyable<SetEx<E>>
This implementation leverages
Indexer
to take care of the mappings
between objects and indexes. The indexer itself acts as the context object.- See Also:
-
Field Summary
Fields inherited from class pascal.taie.util.collection.GenericBitSet
bitSet
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Object
protected E
getElement
(int index) Maps an index to the corresponding object.protected int
Maps an object to the corresponding index.protected GenericBitSet<E>
newSet()
Creates and returns a new set.Methods inherited from class pascal.taie.util.collection.GenericBitSet
add, addAll, addAllDiff, clear, contains, containsAll, copy, hashCode, hasOverlapWith, isEmpty, iterator, remove, removeAll, retainAll, setTo, size
Methods inherited from class java.util.AbstractSet
equals
Methods inherited from class java.util.AbstractCollection
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
Methods inherited from interface java.util.Set
equals, spliterator, toArray, toArray
-
Constructor Details
-
IndexerBitSet
-
-
Method Details
-
getContext
- Specified by:
getContext
in classGenericBitSet<E>
- Returns:
- the context for the objects represented by the bits in this set.
-
getIndex
Description copied from class:GenericBitSet
Maps an object to the corresponding index.- Specified by:
getIndex
in classGenericBitSet<E>
-
getElement
Description copied from class:GenericBitSet
Maps an index to the corresponding object.- Specified by:
getElement
in classGenericBitSet<E>
-
newSet
Description copied from class:AbstractSetEx
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 ofAbstractSetEx.copy()
andAbstractSetEx.addAllDiff(Collection)
. If a subclass overwrites above two methods, it does not need to re-implement this method.- Specified by:
newSet
in classGenericBitSet<E>
-