jAudioFeatureExtractor
クラス BatchExecutionThread

java.lang.Object
  上位を拡張 java.lang.Thread
      上位を拡張 jAudioFeatureExtractor.BatchExecutionThread
すべての実装されたインタフェース:
Updater, java.lang.Runnable

public class BatchExecutionThread
extends java.lang.Thread
implements Updater

GUI components that handles the execution of the feature extraction. The unusual structure is to get around the limitations of Swing - since swing is not thread safe, gui componenets can only operate from the main thread without race conditions. This means that either long running activities must execute on the main thread (making the system unresponsive) or fire updates on the main thread, potentially causing race conditions. This problem can be circumvented by pumping updates to the main event thread via small runnable objects (Geary 1999, 281-91). It works, but makes for obscure code with several inner or anonymous classes that encapsulate a message to the gui thread.

Geary, D. 1999. Graphic Java 2: Mastering the JFC. Palo Alto: Sun Microsystems.

作成者:
Daniel McEnnis

入れ子のクラスの概要
 
クラス java.lang.Thread から継承された入れ子のクラス/インタフェース
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
フィールドの概要
 
クラス java.lang.Thread から継承されたフィールド
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
コンストラクタの概要
BatchExecutionThread(Controller controller, OuterFrame of)
          Creates a new thread.
 
メソッドの概要
 void announceUpdate(int fileDone)
          Called at periodic intervals during the execution of the code.
 void announceUpdate(int fileNumber, int fileDone)
          Called after each file executes
 void run()
          Executes a batch.
 void setFileLength(int windows)
          Informs the file progress bar on how many windows of data are present in this file.
 void setNumberOfFiles(int files)
          Informs the batch progress bar about many files are present in this batch.
 
クラス java.lang.Thread から継承されたメソッド
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

BatchExecutionThread

public BatchExecutionThread(Controller controller,
                            OuterFrame of)
Creates a new thread. Prepares the thread for execution, creating each of the runnable objects that can be later inserted into the swing event queue.

パラメータ:
controller - Near global object containing actions and model components.
of - Reference to the main frame so it can be disabled during execution - preventing modification to the system in mid run.
メソッドの詳細

run

public void run()
Executes a batch. Executes in its own thread, communicating with the swing thread via runnable objects that are inserted into the swing thread. Acts as a controller in a classic MVC pattern (with the batches as model and the swing thread as view).

定義:
インタフェース java.lang.Runnable 内の run
オーバーライド:
クラス java.lang.Thread 内の run

announceUpdate

public void announceUpdate(int fileNumber,
                           int fileDone)
Called after each file executes

定義:
インタフェース Updater 内の announceUpdate
パラメータ:
fileNumber - How many files are completed.
fileDone - Position in the file (usually 0).

announceUpdate

public void announceUpdate(int fileDone)
Called at periodic intervals during the execution of the code.

定義:
インタフェース Updater 内の announceUpdate
パラメータ:
fileDone - Position in file.

setNumberOfFiles

public void setNumberOfFiles(int files)
Informs the batch progress bar about many files are present in this batch.

定義:
インタフェース Updater 内の setNumberOfFiles
パラメータ:
files - Number of files to be processed.

setFileLength

public void setFileLength(int windows)
Informs the file progress bar on how many windows of data are present in this file.

定義:
インタフェース Updater 内の setFileLength
パラメータ:
windows - Total number of windows of data to be processed.