|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.util.ValueWatcher
public class ValueWatcher
Looks out for an unused value in a sequence of submitted numbers. This can be used to identify a suitable 'magic' representation for a bad value.
Constructor Summary | |
---|---|
ValueWatcher(long loBound,
long hiBound)
Constructs a ValueWatcher which will look out for values in the range covered by loBound and hiBound
inclusive. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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)Method Detail |
---|
public void useValue(long val)
val
will never subsequently
be returned from getUnused()
.
val
- value to notepublic Long getUnused()
loBound..hiBound
which
has never been sumitted to useValue(long)
.
If there is no such value, returns null.
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |