edu.udo.cs.yale.tools.math
Class SimplePeakFinder

java.lang.Object
  extended by edu.udo.cs.yale.tools.math.SimplePeakFinder
All Implemented Interfaces:
PeakFinder

public class SimplePeakFinder
extends java.lang.Object
implements PeakFinder

This simple implementation returns a peak if the specified number of neighbors is smaller than the current value.

Version:
$Id: SimplePeakFinder.java,v 1.10 2006/08/03 14:39:34 ingomierswa Exp $
Author:
Ingo Mierswa

Field Summary
private  int numberOfNeighbours
           
 
Constructor Summary
SimplePeakFinder(int neighbours)
           
 
Method Summary
 java.util.List<Peak> getPeaks(Peak[] series)
          Returns a list with peaks.
private  boolean isOk(Peak[] series, int current, int index)
          In the minimum case this method returns true, if the current value is bigger than the index value.
private  boolean isPeak(Peak[] series, int index)
          Returns true if the value for index is an extremum of the given type between the given numbers of neighbours.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numberOfNeighbours

private int numberOfNeighbours
Constructor Detail

SimplePeakFinder

public SimplePeakFinder(int neighbours)
Method Detail

getPeaks

public java.util.List<Peak> getPeaks(Peak[] series)
Returns a list with peaks.

Specified by:
getPeaks in interface PeakFinder


isPeak

private boolean isPeak(Peak[] series,
                       int index)
Returns true if the value for index is an extremum of the given type between the given numbers of neighbours.


isOk

private boolean isOk(Peak[] series,
                     int current,
                     int index)
In the minimum case this method returns true, if the current value is bigger than the index value.



Copyright © 2001-2006