Skip to content
Snippets Groups Projects
Commit 64c3d23b authored by Eilert Tunheim's avatar Eilert Tunheim
Browse files

updated the DB class to search for dryingperiods containing actual data instead of just the dates

parent 6035f297
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,8 @@ package com.application.DB; ...@@ -2,6 +2,8 @@ package com.application.DB;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;
/** /**
* This class contains constants to be used related to database activities * This class contains constants to be used related to database activities
......
...@@ -161,11 +161,11 @@ public class DB { ...@@ -161,11 +161,11 @@ public class DB {
Map<String, String> results; Map<Integer, Map<String, Number>> results;
while(true){ while(true){
System.out.printf("\nExtra parameters:\n %s\n\n",extraInputParameter); System.out.printf("\nExtra parameters:\n %s\n\n",extraInputParameter);
// Retrieves the dates // Retrieves the dates
results = getZeroPointDate(extraInputParameter); results = getKwh(getZeroPointDate(extraInputParameter));
// Checks if any dates where found, if not parameters are removed until dates are found // Checks if any dates where found, if not parameters are removed until dates are found
if(results.size()<NUMBER_OF_PERIODS){ if(results.size()<NUMBER_OF_PERIODS){
...@@ -177,7 +177,7 @@ public class DB { ...@@ -177,7 +177,7 @@ public class DB {
System.out.println("Tree species is removed"); System.out.println("Tree species is removed");
} else if(extraInputParameter.contains(dimensions)) { } else if(extraInputParameter.contains(dimensions)) {
extraInputParameter = extraInputParameter.replace(dimensions,""); extraInputParameter = extraInputParameter.replace(dimensions,"");
System.out.println("Height is removed"); System.out.println("Dimensions is removed");
} else if(extraInputParameter.contains(moistureGoal)) { } else if(extraInputParameter.contains(moistureGoal)) {
extraInputParameter = extraInputParameter.replace(moistureGoal,""); extraInputParameter = extraInputParameter.replace(moistureGoal,"");
System.out.println("Moisture goal is removed"); System.out.println("Moisture goal is removed");
...@@ -185,7 +185,7 @@ public class DB { ...@@ -185,7 +185,7 @@ public class DB {
} }
else break; else break;
} }
return getKwh(results); return results;
} }
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment