Gruppe 1
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DetectionReport.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. package com.example.ueberwachungssystem.Detection;
  2. import android.util.Log;
  3. import java.util.Calendar;
  4. /** Detection Report Class */
  5. public class DetectionReport {
  6. public String timeStamp;
  7. public String detectionType;
  8. public float detectedValue;
  9. public boolean detectionState;
  10. public DetectionReport(boolean detectionState, String detectionType, float detectedAmplitude) {
  11. this.timeStamp = String.valueOf(Calendar.getInstance().getTime());
  12. this.detectionType = detectionType;
  13. this.detectedValue = detectedAmplitude;
  14. this.detectionState = detectionState;
  15. //this.detectorID = detectorID;
  16. }
  17. /** Get Detection Report in String format */
  18. public String toString() {
  19. String state = "State: " + "[" + this.detectionState + "]";
  20. String time = "Time: " + "[" + this.timeStamp + "]";
  21. String type = "Type: " + "[" + this.detectionType + "]";
  22. String value = "Value: " + "[" + this.detectedValue + "]";
  23. return String.join("\t", state, time, type, value);
  24. }
  25. /** Debug Report */
  26. public void log(String tag) {
  27. Log.d(tag, this.toString());
  28. }
  29. }