Class CancelableDummy

java.lang.Object
de.stefanreiser.swing.worker.CancelableDummy
All Implemented Interfaces:
Cancelable

public final class CancelableDummy
extends java.lang.Object
implements Cancelable
A "Dummy"-Cancelable. Does not cancel() anything, always returns hasReceivedCancelCommand() == false. To be used where a Cancelable-Object is needed while its function (canceling a thread) is not.
Author:
Stefan
  • Constructor Summary

    Constructors 
    Constructor Description
    CancelableDummy()  
  • Method Summary

    Modifier and Type Method Description
    void cancel()
    no-op
    boolean hasReceivedCancelCommand()
    Hier kann der Worker erfahren, ob die Arbeit abgebrochen werden soll.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • cancel

      public void cancel()
      no-op
      Specified by:
      cancel in interface Cancelable
    • hasReceivedCancelCommand

      public boolean hasReceivedCancelCommand()
      Description copied from interface: Cancelable
      Hier kann der Worker erfahren, ob die Arbeit abgebrochen werden soll. Die Methode kann zu Zeitpunkten, zu denen ein Abbruch möglich ist, abgefragt werden. Achtung: Für Implementierungen mit Flags immer "volatile" benutzen!
      Specified by:
      hasReceivedCancelCommand in interface Cancelable
      Returns:
      always false