net.sf.dictccfe.and
Class Thr

java.lang.Object
  extended by net.sf.dictccfe.and.Thr
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
IdxLoader, Search

public abstract class Thr
extends java.lang.Object
implements java.lang.Runnable

Basic class for implementing and controlling background jobs.

Version:
$Revision$
Author:
Daniel Stoinski

Field Summary
private  boolean m_goon
          If the background job has to continue.
private  java.lang.Thread m_thr
          The thread running the background job.
 
Constructor Summary
Thr()
          Initializes an empty object of this class.
 
Method Summary
protected  boolean getGoon()
          If the background job has to continue.
abstract  void run()
          Implements the job executed in the background.
 void start()
          Starts the background job.
 void stop()
          Stops the background job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_thr

private final java.lang.Thread m_thr
The thread running the background job.


m_goon

private boolean m_goon
If the background job has to continue.

Constructor Detail

Thr

public Thr()
Initializes an empty object of this class.

Method Detail

getGoon

protected final boolean getGoon()
If the background job has to continue.

Returns:
true if it has to continue, false if it was stopped.

run

public abstract void run()
Implements the job executed in the background.

Specified by:
run in interface java.lang.Runnable

start

public final void start()
Starts the background job.


stop

public final void stop()
Stops the background job.