Interface Scheduler<I,V>
- Type Parameters:
I- the scheduled entry identifier typeV- the scheduled entry value type
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
Scheduler.InactiveScheduler,Scheduler.ReferenceScheduler
A task scheduler.
- Author:
- Paul Ferraro
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionvoidCancels a previously scheduled task for the object with the specified identifier.voidclose()booleanIndicates whether the entry with the specified identifier is scheduled.static <I,V> Scheduler <I, V> fromReference(Supplier<? extends Scheduler<I, V>> reference) Returns a scheduler that delegates to a scheduler reference.static <I,V> Scheduler <I, V> inactive()Returns an inactive scheduler instance.voidSchedules a task for the object with the specified identifier, using the specified metaData
-
Method Details
-
schedule
-
cancel
Cancels a previously scheduled task for the object with the specified identifier.- Parameters:
id- an object identifier
-
contains
Indicates whether the entry with the specified identifier is scheduled.- Parameters:
id- an object identifier- Returns:
- true, if the specified entry is scheduled, false otherwise.
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-
map
-
inactive
Returns an inactive scheduler instance.- Type Parameters:
I- the scheduled entry identifier typeV- the scheduled entry value type- Returns:
- an inactive scheduler instance.
-
fromReference
Returns a scheduler that delegates to a scheduler reference.- Type Parameters:
I- the scheduled entry identifier typeV- the scheduled entry value type- Parameters:
reference- a scheduler reference- Returns:
- a scheduler that delegates to a scheduler reference.
-