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 SparseLongSet
elements, size -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(long value) Add an integer value to this set.booleanAdd all elements from another int set.booleanaddAll(SparseLongSet that) Add all elements from another int set.voidSet 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 that) static MutableSparseLongSetvoidremove(long value) Remove an integer from this set.Methods inherited from class SparseLongSet
add, contains, containsAny, containsAny, diff, elementAt, foreach, foreachExcluding, getIndex, intersection, isEmpty, isSubset, longIterator, max, pair, parseLongArray, sameValue, singleton, size, toStringModifier and TypeMethodDescriptionstatic SparseLongSetadd(SparseLongSet s, int j) final booleancontains(long x) Does this set contain value x?booleancontainsAny(LongSet set) booleancontainsAny(SparseLongSet set) static SparseLongSetdiff(SparseLongSet A, SparseLongSet B) Compute the asymmetric difference of two sets, a \ b.final longelementAt(int idx) voidforeach(LongSetAction action) Invoke an action on each element of the SetvoidforeachExcluding(LongSet X, LongSetAction action) Invoke an action on each element of the Set, excluding elements of Set Xfinal intgetIndex(long x) @Nullable LongSetintersection(LongSet that) This implementation must not despoil the original value of "this"final booleanisEmpty()booleanfinal longmax()static SparseLongSetpair(long i, long j) static long[]parseLongArray(String str) Reverse of toString(): "{2,3}" -> [2,3]booleanstatic SparseLongSetsingleton(int i) final intsize()toString()
-
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: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
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
Description copied from interface:MutableLongSetInterset this with another set.- Specified by:
intersectWithin interfaceMutableLongSet
-
intersectWith
-
addAll
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
Add all elements from another int set.- Returns:
- true iff this set changes
-