|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindprod.common11.Limiter
public final class Limiter
Simple methods to corral values into bounds.
Field Summary | |
---|---|
(package private) static boolean |
DEBUGGING
true if you want extra debugging output and test code |
Method Summary | |
---|---|
static int |
cap(int v,
int high)
Caps the max value, ensuring it does not go too high. |
static int |
corral(int v,
int low,
int high)
Corrals a value back into safe bounds. |
static int |
hem(int v,
int low)
Ensures a value does not go too low. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final boolean DEBUGGING
Method Detail |
---|
public static int cap(int v, int high)
v
- the valuehigh
- the high bound above which v cannot go.
Math.min(int, int)
public static int corral(int v, int low, int high)
v
- the valuelow
- the low bound below which v cannot go.high
- the high bound above which v cannot go.
public static int hem(int v, int low)
v
- the valuelow
- the low bound below which v cannot go.
Math.max(int, int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |