public class ValueWatcher
extends java.lang.Object
Constructor and Description |
---|
ValueWatcher(long loBound,
long hiBound)
Constructs a ValueWatcher which will look out for values in the
range covered by
loBound and hiBound
inclusive. |
Modifier and Type | Method and Description |
---|---|
java.lang.Long |
getUnused()
Returns a value in the range
loBound..hiBound which
has never been sumitted to useValue(long) . |
void |
useValue(long val)
Takes note of a value.
|
public ValueWatcher(long loBound, long hiBound)
loBound
and hiBound
inclusive. These shouldn't be arbitrarily far apart -
storage of up to about one bit per value in the range will be
required.loBound
- lower bound to watch for (inclusive)hiBound
- upper bound to watch for (inclusive)public void useValue(long val)
val
will never subsequently
be returned from getUnused()
.val
- value to notepublic java.lang.Long getUnused()
loBound..hiBound
which
has never been sumitted to useValue(long)
.
If there is no such value, returns null.