gov.nist.microanalysis.EPQTools
Class EMSAFile

java.lang.Object
  extended by gov.nist.microanalysis.EPQLibrary.BaseSpectrum
      extended by gov.nist.microanalysis.EPQTools.EMSAFile
All Implemented Interfaces:
ISpectrumData, java.lang.Comparable

public class EMSAFile
extends BaseSpectrum

A class for reading EMSA files

Copyright: Pursuant to title 17 Section 105 of the United States Code this software is not subject to copyright protection and is in the public domain

Company: National Institute of Standards and Technology

Version:
1.0
Author:
Nicholas W. M. Ritchie

Field Summary
 
Fields inherited from class gov.nist.microanalysis.EPQLibrary.BaseSpectrum
mHashCode, NULL_HASH, NullSpectrum
 
Constructor Summary
EMSAFile()
           
 
Method Summary
 int getChannelCount()
          getChannelCount - Returns the number of channels in the spectrum (nominally 2048)
 double getChannelWidth()
          getChannelWidth - Returns the width of each channel (in eV)
 double getCounts(int i)
          getCounts - Return the counts in the i-th channel
 SpectrumProperties getProperties()
          getProperties - Returns the SpectrumProperties object associated with this spectrum.
 double getZeroOffset()
          getZeroOffset - Returns the energy of the first channel.
static boolean isInstanceOf(java.io.InputStream is)
          Is the file specified by this Reader likely to be a EMSAFile.
 void read(java.io.InputStream is)
          read - reads the parsed file in EMSA format and converts it into the intermediate format, ISpectrumData.
 void setFilename(java.lang.String filename)
           
 
Methods inherited from class gov.nist.microanalysis.EPQLibrary.BaseSpectrum
compareTo, equals, hashCode, initializeSpectrumIndex, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EMSAFile

public EMSAFile()
Method Detail

isInstanceOf

public static boolean isInstanceOf(java.io.InputStream is)
Is the file specified by this Reader likely to be a EMSAFile.

Parameters:
is - InputStream - Which will be closed by isInstanceOf
Returns:
boolean

getChannelCount

public int getChannelCount()
Description copied from interface: ISpectrumData
getChannelCount - Returns the number of channels in the spectrum (nominally 2048)

Returns:
int

getCounts

public double getCounts(int i)
Description copied from interface: ISpectrumData
getCounts - Return the counts in the i-th channel

Returns:
double

getZeroOffset

public double getZeroOffset()
Description copied from interface: ISpectrumData
getZeroOffset - Returns the energy of the first channel.

Returns:
double

getChannelWidth

public double getChannelWidth()
Description copied from interface: ISpectrumData
getChannelWidth - Returns the width of each channel (in eV)

Returns:
double

getProperties

public SpectrumProperties getProperties()
Description copied from interface: ISpectrumData
getProperties - Returns the SpectrumProperties object associated with this spectrum. SpectrumProperties are the mechanism by which contextual data is associated with spectra.

Returns:
SpectrumProperties

read

public void read(java.io.InputStream is)
          throws java.io.IOException
read - reads the parsed file in EMSA format and converts it into the intermediate format, ISpectrumData.

Parameters:
is - FileReader - the EMSA file
Throws:
java.io.IOException - throws an IOException if there is an error reading the file

setFilename

public void setFilename(java.lang.String filename)