/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package motif;

/**
 *
 * @author smuRf
 */
public class RepetitionMotifDectorHanson implements MotifDetector{
    private String type = "";
    
    @Override
    public boolean detect(int intervalStartIndex, Double[] postIntervals, Double[] preIntervals, Double[] postIntervalPattern, Double[] preIntervalPattern, Double[] durations, Double[] durationsPattern) {
        boolean equal = true;
        type = "repetition";
        for(int k = 0; k < postIntervalPattern.length; k++)
        {
            if(postIntervals[k].doubleValue() != postIntervalPattern[k].doubleValue() ||
               durations[k].doubleValue() != durationsPattern[k].doubleValue())
            {
                equal = false;
                type = "";
                break;
            }
        }
               
        return equal;
    }

    @Override
    public String getType() {
        return type;
    }
}
