Class RangedRunnable<T>
java.lang.Object
VASSAL.tools.concurrent.RangedRunnable<T>
- Type Parameters:
T
- the type of the lower and upper bounds in the range
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
Progressor
A
Runnable
which operates on a rolling range.
A RangedRunnable
can be updated after it has been submitted but
before it has been run. This cuts down on the number of times the
RangedRunnable
must be submitted, and is appropriate for values
where only the most recent update matters.- Since:
- 3.1.11
- Author:
- Joel Uckelman
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRangedRunnable
(T init) Creates a newRangedRunnable
with the given lower bound. -
Method Summary
-
Field Details
-
range
-
submitted
protected boolean submitted
-
-
Constructor Details
-
RangedRunnable
Creates a newRangedRunnable
with the given lower bound.- Parameters:
init
- the initial lower bound
-
-
Method Details
-
run
-
setLast
Sets the value of the upper end of the range.- Parameters:
last
- the value to setsubmit
- whether to also submit the change
-
submit
protected abstract void submit()Hands theRangedRunnable
off to be executed.This method may be executed only from .
-
run
-