java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.mass_spectrometry.spectra.Peak
All Implemented Interfaces:
Serializable

public class Peak
extends ExperimentObject
This class represents a peak.
Author:
Marc Vaudel
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • Peak

      public Peak()
      Empty default constructor
    • 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
  • Method Details

    • 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
    • getMass

      public double getMass​(int chargeValue)
      Returns the mass of the compound with the given charge.
      Parameters:
      chargeValue - the value of the charge
      Returns:
      the mass of the compound with the given charge
    • toString

      public String toString()
      Overrides:
      toString in class Object