Class SparseVector<T extends @Nullable Object>
java.lang.Object
com.ibm.wala.util.collections.SparseVector<T>
- All Implemented Interfaces:
IVector<T>
,Serializable
,Iterable<T>
public class SparseVector<T extends @Nullable Object>
extends Object
implements IVector<T>, Serializable
An
IVector
implementation designed for low occupancy. Note that get() from this vector is
a binary search.
This should only be used for small sets ... insertion and deletion are linear in size of set.
- See Also:
-
Constructor Details
-
SparseVector
public SparseVector() -
SparseVector
public SparseVector(int initialSize, float expansion)
-
-
Method Details
-
get
-
set
-
performVerboseAction
public void performVerboseAction()- Specified by:
performVerboseAction
in interfaceIVector<T extends @Nullable Object>
- See Also:
-
iterator
-
getMaxIndex
- Specified by:
getMaxIndex
in interfaceIVector<T extends @Nullable Object>
- Returns:
- max i s.t get(i) != null
- Throws:
IllegalStateException
-
size
public int size() -
iterateIndices
-
safeIterateIndices
This iteration _will_ cover all indices even when remove is called while the iterator is active. -
clear
public void clear() -
remove
public void remove(int x)
-