Class MutableSparseLongSet
java.lang.Object
com.ibm.wala.util.intset.SparseLongSet
com.ibm.wala.util.intset.MutableSparseLongSet
- All Implemented Interfaces:
LongSet
,MutableLongSet
A sparse ordered, mutable duplicate-free, fully-encapsulated set of longs. Instances are not
canonical, except for EMPTY.
This implementation will be inefficient if these sets get large.
TODO: even for small sets, we probably want to work on this to reduce the allocation activity.
-
Field Summary
Fields inherited from class com.ibm.wala.util.intset.SparseLongSet
elements, size
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(long value) Add an integer value to this set.boolean
Add all elements from another int set.boolean
addAll
(SparseLongSet that) Add all elements from another int set.void
Set the value of this to be the same as the value of setstatic MutableSparseLongSet
createMutableSparseLongSet
(int initialCapacity) void
intersectWith
(LongSet set) Interset this with another set.void
static MutableSparseLongSet
void
remove
(long value) Remove an integer from this set.Methods inherited from class com.ibm.wala.util.intset.SparseLongSet
add, contains, containsAny, containsAny, diff, elementAt, foreach, foreachExcluding, getIndex, intersection, isEmpty, isSubset, longIterator, max, pair, parseLongArray, sameValue, singleton, size, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.ibm.wala.util.intset.LongSet
contains, containsAny, foreach, foreachExcluding, intersection, isEmpty, isSubset, longIterator, max, sameValue, size
-
Constructor Details
-
MutableSparseLongSet
public MutableSparseLongSet(long[] backingStore) -
MutableSparseLongSet
public MutableSparseLongSet()
-
-
Method Details
-
make
- Throws:
UnimplementedError
-
createMutableSparseLongSet
-
remove
@NullUnmarked public void remove(long value) Description copied from interface:MutableLongSet
Remove an integer from this set.- Specified by:
remove
in interfaceMutableLongSet
-
add
public boolean add(long value) Description copied from interface:MutableLongSet
Add an integer value to this set.- Specified by:
add
in interfaceMutableLongSet
- Returns:
- true iff this value changes
-
copySet
Description copied from interface:MutableLongSet
Set the value of this to be the same as the value of set- Specified by:
copySet
in interfaceMutableLongSet
- Throws:
UnimplementedError
- if not ( that instanceof com.ibm.wala.util.intset.SparseLongSet )
-
intersectWith
Description copied from interface:MutableLongSet
Interset this with another set.- Specified by:
intersectWith
in interfaceMutableLongSet
-
intersectWith
-
addAll
Add all elements from another int set.- Specified by:
addAll
in interfaceMutableLongSet
- Returns:
- true iff this set changes
- Throws:
UnimplementedError
- if not ( set instanceof com.ibm.wala.util.intset.SparseLongSet )
-
addAll
Add all elements from another int set.- Returns:
- true iff this set changes
-