|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--jumbo.euclid.IntSet
public class IntSet Stores a unique set of ints (i.e. cannot contain duplicate ints. The limits can be set with setMin and setMax. There are operations for combining sets (e.g. NOT, OR) and sets can be built up incrementally.
Inverse mapping. IntSets can be used to map one set of indexed data to another, e.g.
RealArray x = someFunction();
InstSet idx = x.indexSortAscending();
for (int i = 0; i < x.size(); i++) {
y[i] = x[idx[i]];
}
To map the other way, x[i] = y[inv[i]]; the inverse IntSet can be
used
| Constructor Summary | |
IntSet()
|
|
IntSet(int nelem)
creates an IntSet with the integers 0...nelem-1 |
|
IntSet(int[] is)
make from an int[] - all values must be distinct; |
|
IntSet(int start,
int end)
creates an IntSet with the integers start...end (if start <= end) |
|
IntSet(IntSet is)
copy constructor |
|
IntSet(IntSet ref,
IntSet sub)
use another IntSet to subscript this one; i.e. |
|
| Method Summary | |
boolean |
addElement(int value)
add integer. |
void |
addRange(IntRange ir)
add all values from an IntRange |
void |
addSet(IntSet is)
concatenate sets |
boolean |
contains(int value)
|
void |
debug()
|
int |
elementAt(int i)
|
boolean |
equals(IntSet is)
element-by-element comparison of sets |
int[] |
getElements()
|
IntArray |
getIntArray()
|
IntSet |
intersectionWith(IntSet is)
intersect two sets (i.e. |
IntSet |
inverseMap()
Inverse mapping - see introduction. |
IntSet |
notIn(IntSet is)
elements only in first set |
void |
setMax(int max)
|
void |
setMin(int min)
|
int |
size()
|
void |
sortAscending()
sort the IntSet; MODIFIES 'this' |
static void |
test()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Constructor Detail |
public IntSet()
public IntSet(int nelem)
public IntSet(int start,
int end)
public IntSet(IntSet is)
public IntSet(int[] is)
throws BadArgumentException
public IntSet(IntSet ref,
IntSet sub)
throws java.lang.IllegalArgumentException
| Method Detail |
public boolean equals(IntSet is)
public int[] getElements()
public void setMax(int max)
public void setMin(int min)
public int size()
public boolean addElement(int value)
public boolean contains(int value)
public int elementAt(int i)
throws java.lang.ArrayIndexOutOfBoundsException
public IntArray getIntArray()
public void sortAscending()
public void addSet(IntSet is)
public IntSet intersectionWith(IntSet is)
public IntSet notIn(IntSet is)
public void addRange(IntRange ir)
public IntSet inverseMap()
throws java.lang.ArrayIndexOutOfBoundsException
public void debug()
public java.lang.String toString()
public static void test()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||