public final class Limiter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static boolean |
DEBUGGING
true if you want extra debugging output and test code
|
Modifier and Type | Method and Description |
---|---|
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.
|
static final boolean DEBUGGING
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)