Class Alarm

  • All Implemented Interfaces:
    com.intellij.openapi.Disposable

    public class Alarm
    extends java.lang.Object
    implements com.intellij.openapi.Disposable
    Utility class used to execute periodical tasks
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.intellij.openapi.Disposable

        com.intellij.openapi.Disposable.Parent
    • Constructor Summary

      Constructors 
      Constructor Description
      Alarm​(java.lang.String name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRepeatableRequest​(java.lang.Runnable toRun, long delay, long repeatDelay)
      Adds repeatable request to the alarm
      void addRequest​(java.lang.Runnable toRun, long delay, boolean repeatable)
      Adds request to the alarm
      void cancelAllRequests()
      Cancels all requests added to this alarm
      void cancelRequest​(java.lang.Runnable request)
      Cancels specific request added to the alarm
      void dispose()
      Disposes this alarm
      boolean hasRequests()
      Returns true if there are requests added to the alarm
      • Methods inherited from class java.lang.Object

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

      • Alarm

        public Alarm​(@NotNull
                     java.lang.String name)
    • Method Detail

      • dispose

        public void dispose()
        Disposes this alarm
        Specified by:
        dispose in interface com.intellij.openapi.Disposable
      • addRepeatableRequest

        public void addRepeatableRequest​(java.lang.Runnable toRun,
                                         long delay,
                                         long repeatDelay)
        Adds repeatable request to the alarm
        Parameters:
        toRun - runnable to execute
        delay - delay before the first start of the runnable (millis)
        repeatDelay - repeat delay (millis)
      • addRequest

        public void addRequest​(java.lang.Runnable toRun,
                               long delay,
                               boolean repeatable)
        Adds request to the alarm
        Parameters:
        toRun - runnable to execute
        delay - delay before the first start of the runnable (millis)
        repeatable - if true then request will be repeatable, same as: addRepeatableRequest(toRun, delay, delay)
      • cancelAllRequests

        public void cancelAllRequests()
        Cancels all requests added to this alarm
      • cancelRequest

        public void cancelRequest​(java.lang.Runnable request)
        Cancels specific request added to the alarm
        Parameters:
        request - runnable
      • hasRequests

        public boolean hasRequests()
        Returns true if there are requests added to the alarm
        Returns:
        see above