Added check to see if any period was found
This commit is contained in:
@@ -5,14 +5,21 @@ public class LangsteZomerPeriode extends Grootheid{
|
||||
|
||||
//constructor
|
||||
public LangsteZomerPeriode(Measurement measurement1, ArrayList<Measurement> measurement2){
|
||||
setName("Zomerse periode");
|
||||
setName("Zomerse periode");
|
||||
updatePeriod(measurement2);
|
||||
}
|
||||
|
||||
public void updatePeriod(ArrayList<Measurement> measurement2){
|
||||
createList(measurement2);
|
||||
int[] index = StatisticsCalculator.langsteZomersePeriode(list);
|
||||
setPeriod(Calculator.timeStampToPeriode( measurement2.get(index[0]).getDateStamp(), measurement2.get(index[1]).getDateStamp()));
|
||||
if(index[0]==index[1] && index[0]==0)
|
||||
{
|
||||
setCustom("-");
|
||||
}
|
||||
else
|
||||
{
|
||||
setPeriod(Calculator.timeStampToPeriode( measurement2.get(index[0]).getDateStamp(), measurement2.get(index[1]).getDateStamp()));
|
||||
}
|
||||
}
|
||||
|
||||
public void displayGraph(){}
|
||||
|
||||
Reference in New Issue
Block a user