com.compomics.util.experiment.massspectrometry
Class Peak

java.lang.Object
  extended by com.compomics.util.experiment.personalization.ExperimentObject
      extended by com.compomics.util.experiment.massspectrometry.Peak
All Implemented Interfaces:
Serializable, Cloneable

public class Peak
extends ExperimentObject

This class represents a peak.

Author:
Marc Vaudel
See Also:
Serialized Form

Field Summary
 double intensity
          The intensity of the peak.
 double mz
          The mass over charge ratio of the peak.
 double rt
          The retention time when the peak was recorded.
 
Constructor Summary
Peak(double mz, double intensity)
          Constructor for a peak.
Peak(double mz, double intensity, double rt)
          Constructor for a peak.
 
Method Summary
 int compareTo(Peak p)
          Compare two peaks in regards to their intensity.
 boolean equals(Object obj)
           
 double getIntensity()
          Returns the intensity.
 double getMz()
          Returns the mz.
 int hashCode()
           
 boolean isSameAs(Peak aPeak)
          Returns true if the peak has the same mz and intensity.
 void setIntensity(double intensity)
          Set the intensity.
 void setMz(double mz)
          Set the mz.
 
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, getParameterKey, getUrParam
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mz

public double mz
The mass over charge ratio of the peak.


rt

public double rt
The retention time when the peak was recorded.


intensity

public double intensity
The intensity of the peak.

Constructor Detail

Peak

public Peak(double mz,
            double intensity)
Constructor for a peak.

Parameters:
mz - the mz value of the peak
intensity - the intensity of the peak

Peak

public Peak(double mz,
            double intensity,
            double rt)
Constructor for a peak.

Parameters:
mz - the mz value of the peak
intensity - the intensity of the peak
rt - the retention time when the peak was recorded
Method Detail

isSameAs

public boolean isSameAs(Peak aPeak)
Returns true if the peak has the same mz and intensity.

Parameters:
aPeak - the peal to compare this peak to
Returns:
true if the peak has the same mz and intensity

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getMz

public double getMz()
Returns the mz.

Returns:
the mz

setMz

public void setMz(double mz)
Set the mz.

Parameters:
mz - the value to set

getIntensity

public double getIntensity()
Returns the intensity.

Returns:
the intensity

setIntensity

public void setIntensity(double intensity)
Set the intensity.

Parameters:
intensity - the intensity to set

compareTo

public int compareTo(Peak p)
Compare two peaks in regards to their intensity.

Parameters:
p - the peak to compare against
Returns:
0 if numerically equal; a value less than 0 if the intensity of this peak is numerically less than the intensity of the peak we are comparing against; and a value greater than 0 if the intensity of this peak is numerically greater than the intensity of the peak we are comparing against.


Copyright © 2013. All Rights Reserved.