com.compomics.util.general
Class IsotopicDistributionSpectrum

java.lang.Object
  extended by com.compomics.util.general.IsotopicDistributionSpectrum
All Implemented Interfaces:
SpectrumFile, java.lang.Comparable

public class IsotopicDistributionSpectrum
extends java.lang.Object
implements SpectrumFile

This class is an implementation of the SpectrumFile specific for the isotopic distribution Created by IntelliJ IDEA. User: Niklaas Date: 16-Aug-2010 Time: 14:36:23


Constructor Summary
IsotopicDistributionSpectrum()
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Method that compares an IsotopicDistributionSpectrum
 int getCharge()
          Getter for the charge
 java.lang.String getFilename()
          Getter for the filename
 double getHighestIntensity()
          Method that find the intensity of the most intense peak
 double getIntensity()
          Getter for the precursor intensity (here always zero)
 java.util.HashMap getPeaks()
          Getter for the peaks
 double getPrecursorMZ()
          Getter for the precursor MZ
 double getTotalIntensity()
          Method calculates the total intensity of the peaks
 void setCharge(int aCharge)
          Setter for the charge
 void setFilename(java.lang.String aFilename)
          Setter for the filename
 void setIntensity(double aIntensity)
          Setter for the intensity.
 void setPeaks(java.util.HashMap aPeaks)
          Setter for the peaks
 void setPrecursorMZ(double aPrecursorMZ)
          Setter for the precursor MZ
 void writeToFile(java.io.File aParentDir)
          Method to write to a given file
 void writeToStream(java.io.OutputStream aOut)
          Method to write to a givern stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsotopicDistributionSpectrum

public IsotopicDistributionSpectrum()
Method Detail

getCharge

public int getCharge()
Getter for the charge

Specified by:
getCharge in interface SpectrumFile
Returns:
int with the charge

setCharge

public void setCharge(int aCharge)
Setter for the charge

Specified by:
setCharge in interface SpectrumFile
Parameters:
aCharge - int with the charge of the precursor ion.

getFilename

public java.lang.String getFilename()
Getter for the filename

Specified by:
getFilename in interface SpectrumFile
Returns:
String with "Isotopic distribution"

setFilename

public void setFilename(java.lang.String aFilename)
Setter for the filename

Specified by:
setFilename in interface SpectrumFile
Parameters:
aFilename - String with the filename for the file.

getPeaks

public java.util.HashMap getPeaks()
Getter for the peaks

Specified by:
getPeaks in interface SpectrumFile
Returns:
HashMap with the peaks (key = mass, value = intensity)

setPeaks

public void setPeaks(java.util.HashMap aPeaks)
Setter for the peaks

Specified by:
setPeaks in interface SpectrumFile
Parameters:
aPeaks - HashMap with Doubles as keys (the masses) and Doubles as values (the intensities).

getPrecursorMZ

public double getPrecursorMZ()
Getter for the precursor MZ

Specified by:
getPrecursorMZ in interface SpectrumFile
Returns:
double with the precursor MZ

setPrecursorMZ

public void setPrecursorMZ(double aPrecursorMZ)
Setter for the precursor MZ

Specified by:
setPrecursorMZ in interface SpectrumFile
Parameters:
aPrecursorMZ - double with the precursor M/Z

getIntensity

public double getIntensity()
Getter for the precursor intensity (here always zero)

Specified by:
getIntensity in interface SpectrumFile
Returns:
zero

setIntensity

public void setIntensity(double aIntensity)
Setter for the intensity. Here this will do nothing since there is no precursor

Specified by:
setIntensity in interface SpectrumFile
Parameters:
aIntensity - double with the intensity of the precursor ion.

getTotalIntensity

public double getTotalIntensity()
Method calculates the total intensity of the peaks

Specified by:
getTotalIntensity in interface SpectrumFile
Returns:
double with the sum of all the peak intensities

getHighestIntensity

public double getHighestIntensity()
Method that find the intensity of the most intense peak

Specified by:
getHighestIntensity in interface SpectrumFile
Returns:
double with the intensity of the most intense peak

writeToStream

public void writeToStream(java.io.OutputStream aOut)
                   throws java.io.IOException
Method to write to a givern stream

Specified by:
writeToStream in interface SpectrumFile
Parameters:
aOut - OutputStream to write the file to. This Stream will NOT be closed by this method.
Throws:
java.io.IOException

writeToFile

public void writeToFile(java.io.File aParentDir)
                 throws java.io.IOException
Method to write to a given file

Specified by:
writeToFile in interface SpectrumFile
Parameters:
aParentDir - File with the parent directory to put the file in.
Throws:
java.io.IOException

compareTo

public int compareTo(java.lang.Object o)
Method that compares an IsotopicDistributionSpectrum

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - Another IsotopicDistributionSpectrum
Returns:
int (always zero)


Copyright © 2012. All Rights Reserved.