public class SparseLongSet extends Object implements LongSet
| Modifier and Type | Field and Description |
|---|---|
protected long[] |
elements
The backing store of int arrays
|
protected int |
size
The number of entries in the backing store that are valid.
|
| Modifier | Constructor and Description |
|---|---|
|
SparseLongSet()
Subclasses should use this with extreme care.
|
protected |
SparseLongSet(int size) |
|
SparseLongSet(IntSet S) |
protected |
SparseLongSet(long[] backingArray)
Subclasses should use this with extreme care.
|
protected |
SparseLongSet(SparseLongSet S) |
| Modifier and Type | Method and Description |
|---|---|
static SparseLongSet |
add(SparseLongSet s,
int j) |
boolean |
contains(long x)
Does this set contain value x?
|
boolean |
containsAny(LongSet set) |
boolean |
containsAny(SparseLongSet set) |
static SparseLongSet |
diff(SparseLongSet A,
SparseLongSet B)
Compute the asymmetric difference of two sets, a \ b.
|
long |
elementAt(int idx) |
void |
foreach(LongSetAction action)
Invoke an action on each element of the Set
|
void |
foreachExcluding(LongSet X,
LongSetAction action)
Invoke an action on each element of the Set, excluding elements of Set X
|
int |
getIndex(long x) |
LongSet |
intersection(LongSet that)
This implementation must not despoil the original value of "this"
|
boolean |
isEmpty() |
boolean |
isSubset(LongSet that) |
LongIterator |
longIterator() |
long |
max() |
static SparseLongSet |
pair(long i,
long j) |
static long[] |
parseLongArray(String str)
Reverse of toString(): "{2,3}" -> [2,3]
|
boolean |
sameValue(LongSet that) |
static SparseLongSet |
singleton(int i) |
int |
size() |
String |
toString() |
protected long[] elements
protected int size
protected SparseLongSet(int size)
protected SparseLongSet(long[] backingArray)
public SparseLongSet()
protected SparseLongSet(SparseLongSet S)
public SparseLongSet(IntSet S) throws IllegalArgumentException
IllegalArgumentExceptionpublic final boolean contains(long x)
contains in interface LongSetIntSet.contains(int)public final int getIndex(long x)
public final int size()
public final boolean isEmpty()
public final long elementAt(int idx)
throws NoSuchElementException
NoSuchElementExceptionpublic boolean sameValue(LongSet that) throws IllegalArgumentException, UnimplementedError
sameValue in interface LongSetthis has the same value as that.IllegalArgumentExceptionUnimplementedErrorpublic static SparseLongSet diff(SparseLongSet A, SparseLongSet B)
IllegalArgumentException - if A is nullpublic static long[] parseLongArray(String str) throws NumberFormatException, IllegalArgumentException
IllegalArgumentException - if str is nullNumberFormatExceptionpublic static SparseLongSet singleton(int i)
public static SparseLongSet pair(long i, long j)
public LongSet intersection(LongSet that) throws IllegalArgumentException, UnimplementedError
LongSetintersection in interface LongSetIllegalArgumentExceptionUnimplementedErrorIntSet.intersection(com.ibm.wala.util.intset.IntSet)public LongIterator longIterator()
longIterator in interface LongSetIntSet.intIterator()public void foreach(LongSetAction action)
LongSetpublic void foreachExcluding(LongSet X, LongSetAction action)
LongSetforeachExcluding in interface LongSetpublic final long max()
throws IllegalStateException
max in interface LongSetIllegalStateExceptionpublic static SparseLongSet add(SparseLongSet s, int j)
public boolean isSubset(LongSet that) throws IllegalArgumentException, UnimplementedError
isSubset in interface LongSetthis is a subset of that.IllegalArgumentExceptionUnimplementedErrorIntSet.isSubset(com.ibm.wala.util.intset.IntSet)public boolean containsAny(LongSet set)
containsAny in interface LongSetIntSet.containsAny(com.ibm.wala.util.intset.IntSet)public boolean containsAny(SparseLongSet set) throws IllegalArgumentException
IllegalArgumentException