com.isti.jplotresp
Class FreqValuesSet

java.lang.Object
  extended by com.isti.util.ErrorMessageMgr
      extended by com.isti.jplotresp.FreqValuesSet
All Implemented Interfaces:
ErrorMsgMgrIntf

public class FreqValuesSet
extends ErrorMessageMgr


Field Summary
protected  java.lang.String fileNameStr
          Input file name.
protected  java.util.ArrayList freqValuesListObj
          List of 'FreqValueBlk' objects.
 
Constructor Summary
FreqValuesSet(java.lang.String fileNameStr)
          Creates a 'FreqValueBlk' objects set manager.
 
Method Summary
static AmpPhaseBlk[] buildAmpPhaseBlkArray(FreqValuesSet ampSetObj, FreqValuesSet phaseSetObj)
          Builds an array of 'AmpPhaseBlk' objects using the "value1" value from the given sets.
 boolean containsSecondValues()
          Determines if the data held by this set contains "second" values (both amp & phase).
 AmpPhaseBlk[] createAmpPhaseBlkArray()
          Builds an array of 'AmpPhaseBlk' objects using the data values from this set.
 double[] createFrequenciesArray()
          Builds an array of frequency values using the frequency values from this set.
 FreqValueBlk getBlkAt(int idx)
          Returns the 'FreqValueBlk' for the given index in this set.
 java.lang.String getFileNameStr()
          Returns the file name for this manager.
 java.lang.String getIDFNameStr()
          Returns the "ID" file name for this manager (the file name with any leading path characters removed).
 boolean isAmpFileName()
          Determines if the filename for this set starts with "AMP".
 boolean isFreqArrayEqual(FreqValuesSet setObj)
          Determines if the frequency array of the given set object is equal to the frequency array for this set object.
 boolean isFreqLogSpacing()
          Determines if the frequency values held by this set are spaced logarithmically.
 boolean isPhaseFileName()
          Determines if the filename for this set starts with "PHA".
 boolean readFileData()
          Reads data in from the file named in the constructor.
 
Methods inherited from class com.isti.util.ErrorMessageMgr
clearErrorMessageString, clearFetchedErrorMessage, enterErrorMessageString, getErrorMessageFlag, getErrorMessageString, getUnfetchedMessageFlag, setErrorMessageString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileNameStr

protected final java.lang.String fileNameStr
Input file name.


freqValuesListObj

protected java.util.ArrayList freqValuesListObj
List of 'FreqValueBlk' objects.

Constructor Detail

FreqValuesSet

public FreqValuesSet(java.lang.String fileNameStr)
Creates a 'FreqValueBlk' objects set manager.

Parameters:
fileNameStr - file name from which data will be read in (via the 'readFileData()' method).
Method Detail

readFileData

public boolean readFileData()
Reads data in from the file named in the constructor.

Returns:
true if successful; false if not (in which case an error message may be fetched via the 'getErrorMessageString()' method).

isFreqArrayEqual

public boolean isFreqArrayEqual(FreqValuesSet setObj)
Determines if the frequency array of the given set object is equal to the frequency array for this set object.

Parameters:
setObj - the 'FreqValuesSet' object to use.
Returns:
true if the frequency array of the given set object is equal to the frequency array for this set object; false if not.

getBlkAt

public FreqValueBlk getBlkAt(int idx)
Returns the 'FreqValueBlk' for the given index in this set.

Parameters:
idx - index value to use.
Returns:
The 'FreqValueBlk' for the given index in this set, or null if none.

createFrequenciesArray

public double[] createFrequenciesArray()
Builds an array of frequency values using the frequency values from this set.

Returns:
A new array of 'double' values.

createAmpPhaseBlkArray

public AmpPhaseBlk[] createAmpPhaseBlkArray()
Builds an array of 'AmpPhaseBlk' objects using the data values from this set. If the "value2" data values are not available then all of returned "phase" values will be set to zero.

Returns:
A new array of 'AmpPhaseBlk' objects.

containsSecondValues

public boolean containsSecondValues()
Determines if the data held by this set contains "second" values (both amp & phase).

Returns:
true if the data held by this set contains "second" values (both amp & phase); false if not.

isFreqLogSpacing

public boolean isFreqLogSpacing()
Determines if the frequency values held by this set are spaced logarithmically.

Returns:
true if the frequency values held by this set are spaced logarithmically; false if not.

isAmpFileName

public boolean isAmpFileName()
Determines if the filename for this set starts with "AMP".

Returns:
true if the filename for this set starts with "AMP"; false if not.

isPhaseFileName

public boolean isPhaseFileName()
Determines if the filename for this set starts with "PHA".

Returns:
true if the filename for this set starts with "PHA"; false if not.

getFileNameStr

public java.lang.String getFileNameStr()
Returns the file name for this manager.

Returns:
The file name for this manager.

getIDFNameStr

public java.lang.String getIDFNameStr()
Returns the "ID" file name for this manager (the file name with any leading path characters removed).

Returns:
The "ID" file name for this manager.

buildAmpPhaseBlkArray

public static AmpPhaseBlk[] buildAmpPhaseBlkArray(FreqValuesSet ampSetObj,
                                                  FreqValuesSet phaseSetObj)
Builds an array of 'AmpPhaseBlk' objects using the "value1" value from the given sets. If a set is omitted then all of its corresponding values will be set to zero.

Parameters:
ampSetObj - set to use for "amp" values, or null for none.
phaseSetObj - set to use for "phase" values, or null for none.
Returns:
A new array of 'AmpPhaseBlk' objects.