tapeutils.zx81
Class TapeConverterParameters

java.lang.Object
  extended bytapeutils.Parameters
      extended bytapeutils.zx81.TapeConverterParameters

public class TapeConverterParameters
extends Parameters

This class holds the parameters for conversion.

Author:
hldswrth

Constructor Summary
TapeConverterParameters()
          Default constructor.
TapeConverterParameters(java.util.Properties props)
          Constructor.
TapeConverterParameters(java.lang.String fileName, java.util.Properties props)
          Constructor given a file name and properties.
TapeConverterParameters(TapeConverterParameters shared)
          Constructor.
 
Method Summary
 void fileNamesUpdated()
          Inform this object that one or more of the file names has been updated.
 ZX81SampleAnalyzerParameters[] getAnalyzerParameters()
          Get the analyzer parameters.
 int getBeginIndex()
           
 int getBeginIndex(boolean[] isDefault)
           
 int getChannel()
           
 int getChannel(boolean[] isDefault)
           
 java.io.File getConfigFile()
          Get the configuration file.
 ZX81SampleAnalyzerParameters getDefaults()
          Get the default parameters for the sample analyzer.
 java.lang.String[] getFileNames()
          Get the file names.
 boolean getInvert()
           
 boolean getInvert(boolean[] isDefault)
           
 int getMinSecondsGap()
           
 int getMinSecondsGap(boolean[] isDefault)
           
 int getNumExpectedFiles()
           
 int getNumExpectedFiles(boolean[] isDefault)
           
 int getNumFiles()
          Get the number of files.
 java.lang.String[] getPFileNames(boolean knownOnly)
          Get the file names as .P files.
 java.lang.String getRootName()
          Get the root name of the sample.
 void initialize()
          Initialize the parameters from the current properties object.
 void loadConfigFile(java.io.File configFile)
          Initialise the parameters from the configuration file.
 void sampleSaved(java.io.File newFile)
          Handle the siutation where the sample is saved to a new name.
 void saveConfigFile(java.io.File configFile)
          Save the parameters to the configuration file.
 boolean setBeginIndex(int newValue)
           
 boolean setChannel(int newValue)
           
 void setConfigFile(java.io.File configFile)
          Updates the configuration file name without reloading the properties.
 void setFileNames(java.lang.String fileNames)
          Set the file names.
 boolean setInvert(boolean newValue)
           
 boolean setMinSecondsGap(int newValue)
           
 boolean setNumExpectedFiles(int newValue)
           
 void setNumFiles(int numFiles)
          Set the number of files actually in the sample.
 void setSampleFileName(java.lang.String sampleFileName, boolean initialize)
          Set the sample file name.
 
Methods inherited from class tapeutils.Parameters
getValue, getValue, init, setValue, updatePropertyKeyRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TapeConverterParameters

public TapeConverterParameters()
Default constructor.


TapeConverterParameters

public TapeConverterParameters(TapeConverterParameters shared)
Constructor.

Parameters:
shared -

TapeConverterParameters

public TapeConverterParameters(java.util.Properties props)
Constructor.

Parameters:
props -

TapeConverterParameters

public TapeConverterParameters(java.lang.String fileName,
                               java.util.Properties props)
Constructor given a file name and properties.

Parameters:
fileName -
props -
Method Detail

setSampleFileName

public void setSampleFileName(java.lang.String sampleFileName,
                              boolean initialize)
Set the sample file name.

Parameters:
sampleFileName -
initialize -

sampleSaved

public void sampleSaved(java.io.File newFile)
Handle the siutation where the sample is saved to a new name.

Duplicate the parameters for the sample under the new name if none exist under that name.

Parameters:
newFile - The new file

setConfigFile

public void setConfigFile(java.io.File configFile)
Updates the configuration file name without reloading the properties.

Parameters:
configFile -

loadConfigFile

public void loadConfigFile(java.io.File configFile)
                    throws java.io.IOException
Initialise the parameters from the configuration file.

Parameters:
configFile -
Throws:
java.io.IOException - An error occurred reading the config file.

saveConfigFile

public void saveConfigFile(java.io.File configFile)
                    throws java.io.IOException
Save the parameters to the configuration file.

Parameters:
configFile -
Throws:
java.io.IOException - An error occurred reading the config file.

initialize

public void initialize()
Initialize the parameters from the current properties object.


setFileNames

public void setFileNames(java.lang.String fileNames)
Set the file names.

Parameters:
fileNames - The file names.

fileNamesUpdated

public void fileNamesUpdated()
Inform this object that one or more of the file names has been updated.

The analyzers are assumed to already be in sync with the properties object so no re-initialization is done.


setNumFiles

public void setNumFiles(int numFiles)
Set the number of files actually in the sample.

Parameters:
numFiles - The number of files.

getRootName

public java.lang.String getRootName()
Get the root name of the sample.

Returns:
The root name.

getNumFiles

public int getNumFiles()
Get the number of files.

Returns:
The number of files.

getFileNames

public java.lang.String[] getFileNames()
Get the file names.

Returns:
The file names.

getPFileNames

public java.lang.String[] getPFileNames(boolean knownOnly)
Get the file names as .P files.

The "known" file names consist of either the set of file names specified in the config file, or just the root name.

Parameters:
knownOnly - Only return the known file names.
Returns:
The file names.

getConfigFile

public java.io.File getConfigFile()
Get the configuration file.

Returns:
The configuration file.

getDefaults

public ZX81SampleAnalyzerParameters getDefaults()
Get the default parameters for the sample analyzer.

Returns:
The defaults.

getAnalyzerParameters

public ZX81SampleAnalyzerParameters[] getAnalyzerParameters()
Get the analyzer parameters.

Returns:
The file names.

setInvert

public boolean setInvert(boolean newValue)
Parameters:
newValue -
Returns:
Indicates whether the value has been updated.

setChannel

public boolean setChannel(int newValue)
Parameters:
newValue -
Returns:
Indicates whether the value has been updated.

setBeginIndex

public boolean setBeginIndex(int newValue)
Parameters:
newValue -
Returns:
Indicates whether the value has been updated.

setMinSecondsGap

public boolean setMinSecondsGap(int newValue)
Parameters:
newValue -
Returns:
Indicates whether the value has been updated.

setNumExpectedFiles

public boolean setNumExpectedFiles(int newValue)
Parameters:
newValue -
Returns:
Indicates whether the value has been updated.

getInvert

public boolean getInvert()
Returns:
The value

getInvert

public boolean getInvert(boolean[] isDefault)
Parameters:
isDefault -
Returns:
The value

getChannel

public int getChannel()
Returns:
The value

getChannel

public int getChannel(boolean[] isDefault)
Parameters:
isDefault -
Returns:
The value

getBeginIndex

public int getBeginIndex()
Returns:
The value

getBeginIndex

public int getBeginIndex(boolean[] isDefault)
Parameters:
isDefault -
Returns:
The value

getMinSecondsGap

public int getMinSecondsGap()
Returns:
The value

getMinSecondsGap

public int getMinSecondsGap(boolean[] isDefault)
Parameters:
isDefault -
Returns:
The value

getNumExpectedFiles

public int getNumExpectedFiles()
Returns:
The value

getNumExpectedFiles

public int getNumExpectedFiles(boolean[] isDefault)
Parameters:
isDefault -
Returns:
The value