Interface Cancellable
- All Superinterfaces:
Event
An event which may be cancelled via
This is an interface, and not an abstract class, so that users may define their own object hierarchies. Nevertheless, users should ensure the visibility of cancellation in
cancel(). This is an interface, and not an abstract class, so that users may define their own object hierarchies. Nevertheless, users should ensure the visibility of cancellation in
isCancelled().- Author:
- A248
-
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Marks an event as cancelled.booleanWhether the event has been cancelled, possibly by another listener.
-
Method Details
-
cancel
void cancel()Marks an event as cancelled. The event may never be "uncancelled".
The effect of cancellation is determined by the implementer of the event. Event listeners are always invoked, regardless of cancellation. -
isCancelled
boolean isCancelled()Whether the event has been cancelled, possibly by another listener.
To preserve the integrity of this method call in concurrent environments, implementers should guarantee memory-consistency effects.- Returns:
- true if the event is cancelled, false otherwise
-