Cancellation

Inheritance: java.lang.Object

public class Cancellation

Represents an object for requesting cancellation of an operation.

Learn more

Constructors

Constructor Description
Cancellation() Initializes a new instance of the Cancellation class.

Methods

Method Description
isCancelled() Gets a value indicating that cancellation has been requested.
cancel() Makes a request for cancellation.
cancelAfter(int milliseconds) Makes a request for cancellation after the expiration of specified number of milliseconds.

Cancellation()

public Cancellation()

Initializes a new instance of the Cancellation class.

isCancelled()

public final boolean isCancelled()

Gets a value indicating that cancellation has been requested.

Returns: boolean - A value indicating that cancellation has been requested.

cancel()

public final void cancel()

Makes a request for cancellation.

cancelAfter(int milliseconds)

public final void cancelAfter(int milliseconds)

Makes a request for cancellation after the expiration of specified number of milliseconds.

Parameters:

Parameter Type Description
milliseconds int The number of milliseconds after which an operation will be cancelled.