Package org.apache.sis.internal.system
Class DelayedRunnable.Immediate
java.lang.Object
org.apache.sis.internal.system.DelayedRunnable
org.apache.sis.internal.system.DelayedRunnable.Immediate
- All Implemented Interfaces:
Comparable<Delayed>
,Runnable
,Delayed
- Direct Known Subclasses:
Cache.Strong
,Cache.Work
- Enclosing class:
- DelayedRunnable
A "delayed" task which is actually executed as soon as possible.
The delay is fixed to 0 seconds, however those tasks are still
ordered in a "first created, first executed" basis.
- Since:
- 0.3
- Version:
- 0.3
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.internal.system.DelayedRunnable
DelayedRunnable.Immediate
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final AtomicLong
A counter for ordering the tasks in a "first created, first executed" basis.Fields inherited from class org.apache.sis.internal.system.DelayedRunnable
timestamp
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
COUNTER
A counter for ordering the tasks in a "first created, first executed" basis.
-
-
Constructor Details
-
Immediate
protected Immediate()Creates a new immediate task.
-
-
Method Details
-
getDelay
Returns the delay, which is fixed to 0 in every cases.- Specified by:
getDelay
in interfaceDelayed
- Overrides:
getDelay
in classDelayedRunnable
- Parameters:
unit
- the unit of the value to return (ignored).- Returns:
- the delay, which is fixed to 0.
-
compareTo
Compares this task with the given delayed object for ordering. Theother
object shall be an instance ofDelayedRunnable
. This restriction should be okay since theDelayedExecutor
queue accepts onlyDelayedRunnable
instances.- Specified by:
compareTo
in interfaceComparable<Delayed>
- Overrides:
compareTo
in classDelayedRunnable
- Parameters:
other
- the other delayed object to compare with this delayed task.- Returns:
- -1 if the other task should happen before this one, +1 if it should happen after, or 0.
-