Package com.ibm.wala.util.intset
Class MutableSparseLongSet
- java.lang.Object
-
- com.ibm.wala.util.intset.SparseLongSet
-
- com.ibm.wala.util.intset.MutableSparseLongSet
-
- All Implemented Interfaces:
LongSet,MutableLongSet
public final class MutableSparseLongSet extends SparseLongSet implements 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
Constructors Constructor Description MutableSparseLongSet()MutableSparseLongSet(long[] backingStore)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(long value)Add an integer value to this set.booleanaddAll(LongSet set)Add all elements from another int set.booleanaddAll(SparseLongSet that)Add all elements from another int set.voidcopySet(LongSet that)Set the value of this to be the same as the value of setstatic MutableSparseLongSetcreateMutableSparseLongSet(int initialCapacity)voidintersectWith(LongSet set)Interset this with another set.voidintersectWith(SparseLongSet set)static MutableSparseLongSetmake(LongSet set)voidremove(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
-
-
-
-
Method Detail
-
make
public static MutableSparseLongSet make(LongSet set) throws UnimplementedError
- Throws:
UnimplementedError
-
createMutableSparseLongSet
public static MutableSparseLongSet createMutableSparseLongSet(int initialCapacity)
-
remove
@NullUnmarked public void remove(long value)
Description copied from interface:MutableLongSetRemove an integer from this set.- Specified by:
removein interfaceMutableLongSet
-
add
public boolean add(long value)
Description copied from interface:MutableLongSetAdd an integer value to this set.- Specified by:
addin interfaceMutableLongSet- Returns:
- true iff this value changes
-
copySet
@NullUnmarked public void copySet(LongSet that) throws UnimplementedError
Description copied from interface:MutableLongSetSet the value of this to be the same as the value of set- Specified by:
copySetin interfaceMutableLongSet- Throws:
UnimplementedError- if not ( that instanceof com.ibm.wala.util.intset.SparseLongSet )
-
intersectWith
public void intersectWith(LongSet set)
Description copied from interface:MutableLongSetInterset this with another set.- Specified by:
intersectWithin interfaceMutableLongSet
-
intersectWith
@NullUnmarked public void intersectWith(SparseLongSet set)
-
addAll
public boolean addAll(LongSet set) throws UnimplementedError
Add all elements from another int set.- Specified by:
addAllin interfaceMutableLongSet- Returns:
- true iff this set changes
- Throws:
UnimplementedError- if not ( set instanceof com.ibm.wala.util.intset.SparseLongSet )
-
addAll
public boolean addAll(SparseLongSet that)
Add all elements from another int set.- Returns:
- true iff this set changes
-
-