comirva.io
Class MatrixDataFileLoaderThread

java.lang.Object
  extended by java.lang.Thread
      extended by comirva.io.MatrixDataFileLoaderThread
All Implemented Interfaces:
Runnable

public class MatrixDataFileLoaderThread
extends Thread

This class implements a thread for loading matrix data files. The data files must contain ASCII-exported Matlab-matrices or any other space- or tab-separated matrices in the ASCII-format.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MatrixDataFileLoaderThread(File f)
          Creates a MatrixDataFileLoaderThread for loading a data matrix from File f.
MatrixDataFileLoaderThread(File f, Vector ml)
          Creates a MatrixDataFileLoaderThread for loading a data matrix from File f.
MatrixDataFileLoaderThread(File f, Vector ml, JLabel jl, DefaultListModel lm)
          Creates a MatrixDataFileLoaderThread for loading a data matrix from File f.
 
Method Summary
 DataMatrix getDataMatrix()
          Returns the DataMatrix-instance into which the file content is loaded.
 DataMatrix getMatrixFromFile()
          Opens the file and loads its content into a DataMatrix-instance which is returned thereafter.
 void run()
          This method is called when the thread is started.
 
Methods inherited from class 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MatrixDataFileLoaderThread

public MatrixDataFileLoaderThread(File f,
                                  Vector ml,
                                  JLabel jl,
                                  DefaultListModel lm)
Creates a MatrixDataFileLoaderThread for loading a data matrix from File f.

Parameters:
f - the File which contains the matrix data (exported from Matlab)
ml - the Vector to which the name of the DataMatrix should be added after it has been loaded
jl - the JLabel representing the status bar (for writing current loading progress)
lm - the DefaultListModel to add the name of the matrix to the UI

MatrixDataFileLoaderThread

public MatrixDataFileLoaderThread(File f,
                                  Vector ml)
Creates a MatrixDataFileLoaderThread for loading a data matrix from File f.

Parameters:
f - the File which contains the matrix data (exported from Matlab)
ml - the Vector to which the name of the DataMatrix should be added after it has been loaded

MatrixDataFileLoaderThread

public MatrixDataFileLoaderThread(File f)
Creates a MatrixDataFileLoaderThread for loading a data matrix from File f.

Parameters:
f - the File which contains the matrix data (exported from Matlab)
Method Detail

run

public void run()
This method is called when the thread is started. The file is opened, the data read and extracted.

Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Runnable.run()

getMatrixFromFile

public DataMatrix getMatrixFromFile()
                             throws NoMatrixException
Opens the file and loads its content into a DataMatrix-instance which is returned thereafter.

Returns:
the DataMatrix containing the loaded matrix
Throws:
NoMatrixException
See Also:
DataMatrix

getDataMatrix

public DataMatrix getDataMatrix()
Returns the DataMatrix-instance into which the file content is loaded.

Returns:
the DataMatrix containing the loaded matrix
See Also:
DataMatrix