|
JavaGenes, NASA Ames. Written largely by Al Globus | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.alsUtility.IntegerInterval
represent an interval from some low to some high integer
Field Summary | |
protected int |
bottom
|
protected int |
top
|
Constructor Summary | |
IntegerInterval()
create an interval from 0 to 1 |
|
IntegerInterval(IntegerInterval interval)
|
|
IntegerInterval(int x,
int y)
create an interval from x to y or y to x depending on which is lower |
Method Summary | |
void |
addToHigh(int x)
|
void |
addToLow(int x)
|
protected void |
assertLegal()
|
IntegerInterval |
copy()
|
int |
distanceFrom(int value)
|
int |
equalIncrements(int divisions)
|
boolean |
equals(java.lang.Object obj)
|
boolean |
equalsExtremes(int value)
|
void |
expand(int factor)
change the interval of this by a factor keeping the center of the interval the same. |
int[] |
getArrayOfAllValues()
|
int[] |
getRandomUniqueIndices(int number)
for good performance, number must be fairly small and much smaller than intervalInclusive() |
int |
hashCode()
|
int |
high()
|
int |
interval()
|
int |
intervalInclusive()
|
boolean |
isBetween(int value)
|
boolean |
isNonNegative()
|
IntegerInterval |
limitTo(IntegerInterval interval)
|
int |
low()
|
int |
random()
|
void |
set(int x,
int y)
sets the interval from x to y or y to x depending on which is lower |
void |
setHigh(int x)
|
void |
setLow(int x)
|
void |
setToExtremes(int[] array)
sets the interval to the low and high values of array |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int bottom
protected int top
Constructor Detail |
public IntegerInterval()
public IntegerInterval(int x, int y)
public IntegerInterval(IntegerInterval interval)
Method Detail |
public IntegerInterval limitTo(IntegerInterval interval)
public void expand(int factor)
public IntegerInterval copy()
public void set(int x, int y)
public void setLow(int x)
public void setHigh(int x)
public void addToHigh(int x)
public void addToLow(int x)
public boolean isNonNegative()
protected void assertLegal()
public boolean isBetween(int value)
public int distanceFrom(int value)
public void setToExtremes(int[] array)
public boolean equalsExtremes(int value)
public java.lang.String toString()
public int random()
public int[] getRandomUniqueIndices(int number)
public int low()
public int high()
public int interval()
public int intervalInclusive()
public int[] getArrayOfAllValues()
public int equalIncrements(int divisions)
public boolean equals(java.lang.Object obj)
public int hashCode()
|
JavaGenes, NASA Ames. Written largely by Al Globus | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |