org.imirsel.m2k.io
Class InputSignalArrays

java.lang.Object
  extended byjava.util.Observable
      extended byncsa.d2k.core.modules.RootModule
          extended byncsa.d2k.core.modules.ConfigurableModule
              extended byncsa.d2k.core.modules.EmbeddedPipeModule
                  extended byncsa.d2k.core.modules.ExecModule
                      extended byncsa.d2k.core.modules.IOModule
                          extended byncsa.d2k.core.modules.InputModule
                              extended byorg.imirsel.m2k.io.InputSignalArrays
All Implemented Interfaces:
java.lang.Cloneable, ncsa.d2k.core.modules.Module, java.io.Serializable, ncsa.d2k.core.modules.SystemModule

public class InputSignalArrays
extends ncsa.d2k.core.modules.InputModule

Reads in one or more files or directories of files and outputs them as Signal objects. This module has support for the streaming out of mutiple directories, directory recursion and can set classname metadata in the Signal objects with classnames calculated from the directory names, the top-level directories of a directory structure or classnames set manually. This module can also read its settings in from a file and and can save anual settings ot to a file.

Author:
Andreas Ehmann & Kris West
See Also:
Serialized Form

Field Summary
 
Fields inherited from class ncsa.d2k.core.modules.ConfigurableModule
addedInputInfo, addedInputNames, addedInputTypes, addedOutputInfo, addedOutputNames, addedOutputTypes, addPortListeners
 
Fields inherited from class ncsa.d2k.core.modules.RootModule
alias, children, DEBUG_LEVEL, EMPTY_INPUT, ERROR_LEVEL, executionManager, FATAL_LEVEL, HAVE_INPUT, INFO_LEVEL, iPipes, iPipesIndex, iTriggers, oPipes, oPipesIndex, oTriggers, parents, pipesFullManager, stats, triggerChildren, triggerParents, WARN_LEVEL
 
Fields inherited from interface ncsa.d2k.core.modules.SystemModule
BLOCKED_STATE, IDLE_STATE, MEDIUM, MEDIUM_RARE, MEDIUM_WELL, RARE, READY_STATE, WELL, WORKING_STATE
 
Constructor Summary
InputSignalArrays()
          Initialise InputSignals module
 
Method Summary
 void addToVectors(java.lang.String filename, java.lang.String className, boolean recurseSubDirs, java.lang.String substringFileFilter, java.lang.String excludeFileFilter, java.lang.String getNamesFrom)
          Adds a full set of file input data (one record) to the storage vectors, ready to produce the list of files to output.
 void beginExecution()
          Performs operations at the beginning of itinerary execution.
 void doit()
          Reads in one or more files or directories of files and outputs them as Signal objects.
 void endExecution()
          Performs operations at the end of itinerary execution.
 java.lang.String getInputInfo(int i)
          Returns a text description for the indicated input.
 java.lang.String[] getInputTypes()
          Returns an array of strings containing the Java data types of the input.
 java.lang.String getModuleInfo()
          Returns information about the module.
 java.lang.String getModuleName()
          Returns the name of the module.
 java.lang.String getOutputInfo(int i)
          Returns a text description for the given output.
 java.lang.String getOutputName(int i)
          Returns a text name for the given output.
 java.lang.String[] getOutputTypes()
          Returns an array of strings containing the Java data types of the outputs.
 ncsa.d2k.core.modules.PropertyDescription[] getPropertiesDescriptions()
          Returns an array of description objects for each property of the Module.
 java.lang.String getPropertiesFile()
          Returns the value of myStringParameter
 ncsa.d2k.core.modules.CustomModuleEditor getPropertyEditor()
          Return the custom property editor.
 boolean getUsePropertiesFile()
          Returns the value of myStringParameter
 boolean isReady()
          Returns a boolean indicating if the module is ready to execute or not.
 void readParameterFile(java.io.File pFile)
          Read input file parameter settings from a file.
 void removeFromVectors(int i)
          Removes a full set of file input data (one record) from the storage vectors.
 void setPropertiesFile(java.lang.String value)
          Sets the value of myStringParameter
 void setUsePropertiesFile(boolean value)
          Sets the value of myStringParameter
 void writePropertiesFile(java.lang.String fileName)
          Write the current settings to an ascii property file
 
Methods inherited from class ncsa.d2k.core.modules.ExecModule
execute, setExecutionManager
 
Methods inherited from class ncsa.d2k.core.modules.ConfigurableModule
addAddPortListener, addInput, addInputTrigger, addOutput, addOutputTrigger, getAddedInputTypes, getAddedOutputTypes, getAddPortListeners, insertInput, insertOutput, removeAddPortListener, removeInput, removeInputTrigger, removeOutput, removeOutputTrigger, setAddedInputTypes, setInputType, setOutputType
 
Methods inherited from class ncsa.d2k.core.modules.RootModule
activateTriggers, begin, canRun, clone, debug, debug, disconnectInputPipe, disconnectInputTriggers, disconnectOutputPipe, disconnectOutputTriggers, end, error, error, fatal, fatal, fetchInputs, getAlias, getChildIndex, getChildMux, getChildren, getExecutionManager, getFile, getFlags, getFullPipeManager, getGuiComponent, getImage, getInputName, getInputPipes, getInputPipeSize, getInputTriggers, getModuleStatistics, getNumInputs, getNumOutputs, getOutputCounts, getOutputPipes, getOutputPipeSize, getOutputTriggers, getParentIndex, getParentMux, getParents, getPipesFull, getPriority, getResource, getRootName, getState, info, info, initModule, isAborting, isHead, isInputPipeConnected, isOutputPipeConnected, pullInput, pushOutput, resetInputs, setAlias, setBlocked, setD2KModulesLoggingLevel, setFlags, setFullPipeManager, setIdle, setInputPipe, setLogLevel, setModuleStatistics, setModuleStatisticsByMachine, setOutputCounts, setOutputPipe, setPipesFull, setReady, setResource, setState, setThePriority, setWorking, trigger, triggersActivated, warn, warn
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputSignalArrays

public InputSignalArrays()
Initialise InputSignals module

Method Detail

addToVectors

public void addToVectors(java.lang.String filename,
                         java.lang.String className,
                         boolean recurseSubDirs,
                         java.lang.String substringFileFilter,
                         java.lang.String excludeFileFilter,
                         java.lang.String getNamesFrom)
Adds a full set of file input data (one record) to the storage vectors, ready to produce the list of files to output.

Parameters:
filename - File or directory path to add
className - If using manual classnames, the classname to be used, otherwise should be empty String
recurseSubDirs - boolean flag indicating whether a directory should be recursed for files or whether only the toplevel files should be returned.
substringFileFilter - Require this substring to be in returned filenames
excludeFileFilter - exclude fileames with this substring
getNamesFrom - String flag indicating where classnames should come from. Set to "dir", if the directory name is to be used, "topLevelDirs" if the top-level of a directory structure is to be used or "manual" if a manually set classname is to be used.

removeFromVectors

public void removeFromVectors(int i)
Removes a full set of file input data (one record) from the storage vectors.

Parameters:
i - The index of the record to remove.

writePropertiesFile

public void writePropertiesFile(java.lang.String fileName)
                         throws java.io.IOException
Write the current settings to an ascii property file

Parameters:
fileName - The filename to write the file to
Throws:
java.io.IOException - Thrown if an IO error occurs while writing to file, indicates file writing was unsuccessful.

readParameterFile

public void readParameterFile(java.io.File pFile)
Read input file parameter settings from a file.

Parameters:
pFile - The file to read the settings from

setPropertiesFile

public void setPropertiesFile(java.lang.String value)
Sets the value of myStringParameter

Parameters:
value - the value which myStringParameter is set to

getPropertiesFile

public java.lang.String getPropertiesFile()
Returns the value of myStringParameter

Returns:
myStringParameter

setUsePropertiesFile

public void setUsePropertiesFile(boolean value)
Sets the value of myStringParameter

Parameters:
value - the value which myStringParameter is set to

getUsePropertiesFile

public boolean getUsePropertiesFile()
Returns the value of myStringParameter

Returns:
myStringParameter

getPropertiesDescriptions

public ncsa.d2k.core.modules.PropertyDescription[] getPropertiesDescriptions()
Returns an array of description objects for each property of the Module.

Returns:
an array of description objects for each property of the Module.

getModuleName

public java.lang.String getModuleName()
Returns the name of the module.

Returns:
the module name

getModuleInfo

public java.lang.String getModuleInfo()
Returns information about the module.

Returns:
Module information

getInputTypes

public java.lang.String[] getInputTypes()
Returns an array of strings containing the Java data types of the input.

Returns:
the fully qualified java types for each of the inputs

getInputInfo

public java.lang.String getInputInfo(int i)
Returns a text description for the indicated input.

Parameters:
i - the index of the input
Returns:
a text description of the indexed input

getOutputName

public java.lang.String getOutputName(int i)
Returns a text name for the given output.

Parameters:
i - the index of the output
Returns:
the name of the indexed output

getOutputInfo

public java.lang.String getOutputInfo(int i)
Returns a text description for the given output.

Parameters:
i - the index of the output
Returns:
the name of the indexed output

getOutputTypes

public java.lang.String[] getOutputTypes()
Returns an array of strings containing the Java data types of the outputs.

Returns:
the fully qualified java types for each of the outputs.

beginExecution

public void beginExecution()
Performs operations at the beginning of itinerary execution.

See Also:
endExecution()

endExecution

public void endExecution()
Performs operations at the end of itinerary execution.

See Also:
beginExecution()

isReady

public boolean isReady()
Returns a boolean indicating if the module is ready to execute or not.

Returns:
true if the module is ready to execute, false if not.

getPropertyEditor

public ncsa.d2k.core.modules.CustomModuleEditor getPropertyEditor()
Return the custom property editor.

Returns:
the custom property editor

doit

public void doit()
          throws java.io.IOException,
                 noMetadataException
Reads in one or more files or directories of files and outputs them as Signal objects. This module has support for the streaming out of mutiple directories, directory recursion and can set classname metadata in the Signal objects with classnames calculated from the directory names, the top-level directories of a directory structure or classnames set manually. This module can also read its settings in from a file and and can save anual settings ot to a file.

Throws:
java.io.IOException - Thrown if there is a problem reading from disk, may occur if it tries to read a properties file that does not exist.
noMetadataException - Thrown if class metadata wasn't set correctly, shouldn't occur