nl.lxtreme.ols.util
Class AccumulatingRunnable<T>

java.lang.Object
  extended by nl.lxtreme.ols.util.AccumulatingRunnable<T>
Type Parameters:
T - the type this Runnable accumulates
All Implemented Interfaces:
Runnable

public abstract class AccumulatingRunnable<T>
extends Object
implements Runnable

Shameless copy from sun.swing.AccumulatingRunnable.


Constructor Summary
AccumulatingRunnable()
           
 
Method Summary
 void add(T... args)
          appends arguments and sends this for the execution if needed.
 void run()
          
protected abstract  void run(Deque<T> aArguments)
          Equivalent to Runnable.run method with the accumulated arguments to process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccumulatingRunnable

public AccumulatingRunnable()
Method Detail

add

public final void add(T... args)
appends arguments and sends this for the execution if needed.

This implementation uses submit() to send this Runnable for execution.

Parameters:
args - the arguments to accumulate

run

public final void run()

This implementation calls run(List<T> args) mehtod with the list of accumulated arguments.

Specified by:
run in interface Runnable

run

protected abstract void run(Deque<T> aArguments)
Equivalent to Runnable.run method with the accumulated arguments to process.

Parameters:
aArguments - the accumulated arguments to process.


Copyright © 2012 L'Xtreme IT consultancy. All Rights Reserved.