be.hogent.tarsos.util.histogram.peaks
Class Peak

java.lang.Object
  extended by be.hogent.tarsos.util.histogram.peaks.Peak
All Implemented Interfaces:
java.lang.Comparable<Peak>

public final class Peak
extends java.lang.Object
implements java.lang.Comparable<Peak>

Defines a Peak in a histogram.

Author:
Joren Six

Constructor Summary
Peak(double pos, double peakHeight)
          Creates a new peak.
 
Method Summary
 int compareTo(Peak o)
           
 double getHeight()
          The height of the peak (number of occurrences).
 double getPosition()
          The position of the peak in cents.
 void setHeight(double newHeight)
           
 void setPosition(double newPosition)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Peak

public Peak(double pos,
            double peakHeight)
Creates a new peak.

Parameters:
pos - the position in cents
peakHeight - the height of the peak
Method Detail

getHeight

public double getHeight()
The height of the peak (number of occurrences).

Returns:
the height of the peak

getPosition

public double getPosition()
The position of the peak in cents.

Returns:
The position of the peak in cents

setPosition

public void setPosition(double newPosition)
Parameters:
newPosition -

setHeight

public void setHeight(double newHeight)
Parameters:
newHeight -

compareTo

public int compareTo(Peak o)
Specified by:
compareTo in interface java.lang.Comparable<Peak>