package at.jku.pervasive.ecg.wfdb;

import java.util.Scanner;

public class HRV {

  private double AVNN;
  private double SDNN;

  public HRV(String getHrvResult) {
    super();
    System.out.println(getHrvResult);
    parse(getHrvResult);
  }

  public double getAVNN() {
    return AVNN;
  }

  public double getSDNN() {
    return SDNN;
  }

  private void parse(String string) {
    Scanner s = new Scanner(string);
    while (s.hasNextLine()) {
      String l = s.nextLine();
      String[] split = l.split(" = ");
      if (split[0].trim().equals("SDNN")) {
        String dS = split[1];
        this.SDNN = Double.parseDouble(dS);
      } else if (split[0].trim().equals("AVNN")) {
        this.AVNN = Double.parseDouble(split[1]);
      }
    }
  }

}

@@ -101,31 +101,87 @@
 AVNN
-;%0A  private double SDNN
+, SDNN, NNRR, rMSSD, pNN20, pNN50, TOT_PWR, VLF_PWR,%0A      LF_PWR, HF_PWR, LFHF
 ;%0A%0A 
@@ -369,32 +369,508 @@
  get
-SDNN() %7B%0A    return SDNN
+HF_PWR() %7B%0A    return HF_PWR;%0A  %7D%0A%0A  public double getLF_PWR() %7B%0A    return LF_PWR;%0A  %7D%0A%0A  public double getLFHF() %7B%0A    return LFHF;%0A  %7D%0A%0A  public double getNNRR() %7B%0A    return NNRR;%0A  %7D%0A%0A  public double getpNN20() %7B%0A    return pNN20;%0A  %7D%0A%0A  public double getpNN50() %7B%0A    return pNN50;%0A  %7D%0A%0A  public double getrMSSD() %7B%0A    return rMSSD;%0A  %7D%0A%0A  public double getSDNN() %7B%0A    return SDNN;%0A  %7D%0A%0A  public double getTOT_PWR() %7B%0A    return TOT_PWR;%0A  %7D%0A%0A  public double getVLF_PWR() %7B%0A    return VLF_PWR
 ;%0A  

add all properties which are returned for get_hrv command