|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.util.intset.SparseIntSet
public class SparseIntSet
A sparse ordered, duplicate-free, fully-encapsulated set of integers; not necessary mutable
| Field Summary | |
|---|---|
protected int[] |
elements
The backing store of int arrays |
protected int |
size
The number of entries in the backing store that are valid. |
| Constructor Summary | |
|---|---|
|
SparseIntSet()
Subclasses should use this with extreme care. |
protected |
SparseIntSet(int size)
|
protected |
SparseIntSet(int[] backingArray)
Subclasses should use this with extreme care. |
|
SparseIntSet(IntSet S)
|
protected |
SparseIntSet(SparseIntSet S)
|
| Method Summary | |
|---|---|
static SparseIntSet |
add(SparseIntSet s,
int j)
|
boolean |
contains(int x)
Does this set contain value x? |
boolean |
containsAny(IntSet set)
|
boolean |
containsAny(SparseIntSet set)
|
static SparseIntSet |
diff(SparseIntSet A,
SparseIntSet B)
Compute the asymmetric difference of two sets, a \ b. |
static int[] |
diffInternal(SparseIntSet A,
SparseIntSet B)
|
int |
elementAt(int idx)
|
void |
foreach(IntSetAction action)
Invoke an action on each element of the Set |
void |
foreachExcluding(IntSet X,
IntSetAction action)
Invoke an action on each element of the Set, excluding elements of Set X |
int |
getIndex(int x)
|
IntSet |
intersection(IntSet that)
This implementation must not despoil the original value of "this" |
IntIterator |
intIterator()
|
boolean |
isEmpty()
|
boolean |
isSubset(IntSet that)
|
int |
max()
|
static SparseIntSet |
pair(int i,
int j)
|
static int[] |
parseIntArray(java.lang.String str)
Reverse of toString(): "{2,3}" -> [2,3] |
boolean |
sameValue(IntSet that)
|
static SparseIntSet |
singleton(int i)
|
int |
size()
|
int[] |
toIntArray()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int[] elements
protected int size
| Constructor Detail |
|---|
protected SparseIntSet(int size)
protected SparseIntSet(int[] backingArray)
public SparseIntSet()
protected SparseIntSet(SparseIntSet S)
public SparseIntSet(IntSet S)
| Method Detail |
|---|
public final boolean contains(int x)
contains in interface IntSetIntSet.contains(int)public final int getIndex(int x)
public final int size()
size in interface IntSetpublic final boolean isEmpty()
isEmpty in interface IntSet
public final int elementAt(int idx)
throws java.util.NoSuchElementException
java.util.NoSuchElementExceptionpublic boolean sameValue(IntSet that)
sameValue in interface IntSetthis has the same value as
that.
public static SparseIntSet diff(SparseIntSet A,
SparseIntSet B)
public static int[] diffInternal(SparseIntSet A,
SparseIntSet B)
public java.lang.String toString()
toString in class java.lang.Object
public static int[] parseIntArray(java.lang.String str)
throws java.lang.NumberFormatException
java.lang.IllegalArgumentException - if str is null
java.lang.NumberFormatExceptionpublic static SparseIntSet singleton(int i)
public static SparseIntSet pair(int i,
int j)
public IntSet intersection(IntSet that)
IntSet
intersection in interface IntSetpublic IntIterator intIterator()
intIterator in interface IntSet
public final int max()
throws java.lang.IllegalStateException
max in interface IntSetjava.lang.IllegalStateExceptionpublic void foreach(IntSetAction action)
IntSet
foreach in interface IntSet
public void foreachExcluding(IntSet X,
IntSetAction action)
IntSet
foreachExcluding in interface IntSet
public static SparseIntSet add(SparseIntSet s,
int j)
java.lang.IllegalArgumentException - if s is nullpublic boolean isSubset(IntSet that)
isSubset in interface IntSetthis is a subset of that.public boolean containsAny(IntSet set)
containsAny in interface IntSetpublic boolean containsAny(SparseIntSet set)
public int[] toIntArray()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||