gr.demokritos.iit.jinsect.threading
Class ThreadList

java.lang.Object
  extended by gr.demokritos.iit.jinsect.threading.ThreadQueue
      extended by gr.demokritos.iit.jinsect.threading.ThreadList
Direct Known Subclasses:
PooledThreadList

public class ThreadList
extends ThreadQueue

A list of threads for parallel execution. Should probably be replaced by ThreadPoolExecutor.


Field Summary
 
Fields inherited from class gr.demokritos.iit.jinsect.threading.ThreadQueue
Max, qThreads
 
Constructor Summary
ThreadList()
          Initializes a thread list, with the default maximum number of threads running at the same time.
ThreadList(int iMaxThreads)
          Initializes a thread list, with a given maximum of threads running at the same time.
 
Method Summary
 boolean addThreadFor(java.lang.Runnable r)
          Adds a Runnable object in the list for execution, if possible.
 
Methods inherited from class gr.demokritos.iit.jinsect.threading.ThreadQueue
waitUntilCompletion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadList

public ThreadList(int iMaxThreads)
Initializes a thread list, with a given maximum of threads running at the same time.

Parameters:
iMaxThreads - The maximum number of threads running at the same time.

ThreadList

public ThreadList()
Initializes a thread list, with the default maximum number of threads running at the same time.

Method Detail

addThreadFor

public boolean addThreadFor(java.lang.Runnable r)
Adds a Runnable object in the list for execution, if possible. There is no first-in, first-out logic, as opposed to ThreadQueue.

Overrides:
addThreadFor in class ThreadQueue
Parameters:
r - The runnable object to execute.
Returns:
True if the object was queued for execution, or false if the queue was full.