Class SequentialCancellable

  • All Implemented Interfaces:

    public class SequentialCancellable
    extends java.lang.Object
    implements Cancellable
    A Cancellable that can hold at most one Cancellable that will be cancelled when this is cancelled.
    • Constructor Detail

      • SequentialCancellable

        public SequentialCancellable()
        Create a new instance with no current Cancellable.
      • SequentialCancellable

        public SequentialCancellable​(Cancellable cancellable)
        Create a new instance with the current Cancellable set to cancellable.
        cancellable - the initial Cancellable.
    • Method Detail

      • nextCancellable

        public final void nextCancellable​(Cancellable next)
        Sets the current Cancellable.
        next - to set.
      • cancel

        public final void cancel()
        Description copied from interface: Cancellable
        Sends a hint to the producer of the associated asynchronous execution that the consumer related to this Cancellable is not interested in the outcome of the execution.
        Specified by:
        cancel in interface Cancellable
      • isCancelled

        public boolean isCancelled()
        Returns true if this Cancellable is cancelled.
        true if this Cancellable is cancelled.