net.ranides.assira.time
Class LazyInvoker

java.lang.Object
  extended by net.ranides.assira.time.LazyInvoker
All Implemented Interfaces:
Runnable

public abstract class LazyInvoker
extends Object
implements Runnable

Użycie:

   LazyInvoker action = new LazyInvoker(true, 1000) { 
      public void run() {
        // action ...
      }
   };
Następnie np w "onKeyPress" kolejkujemy wykonanie:
  action.runLazy() 
Mimo, że runLazy() może być wywoływane wielokrotnie w odstępach t<1000, to Runnable.run() uruchomi się tylko raz, 1000ms po ostatnim wywołaniu runLazy().

Author:
ranides

Constructor Summary
LazyInvoker(boolean awt, int delay)
           
 
Method Summary
 void runLazy()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

LazyInvoker

public LazyInvoker(boolean awt,
                   int delay)
Method Detail

runLazy

public void runLazy()


Copyright © 2013. All Rights Reserved.