How to organize the method JAVA
below, to get the output as the example. I have an array of schedules (would be input and output), and I need to associate these schedules with a date range, while I was in and out of the the same day I could do it, but in the model below, the input occurs in one day and the output in the other, and one day before and one after the break only has an input or an output ...
Output example I need:
1/1/2018 23:00
2/1/2018 23:00
2/1/2018 06:00
3/1/2018 23:00
3/1/2018 06:00
4/1/2018 06:00
5/1/2018 00:00 (folga)
5/1/2018 00:00 (folga)
6/1/2018 23:00
7/1/2018 23:00
7/1/2018 06:00
8/1/2018 23:00
8/1/2018 06:00
9/1/2018 06:00
10/1/2018 00:00 (folga)
Method:
public void teste5(){
String []hora = new String[8];
String []result = new String[10];
int dia = 1;
int i=0;
hora[0]="23:00";
hora[1]="06:00";
hora[2]="23:00";
hora[3]="06:00";
hora[4]="23:00";
hora[5]="06:00";
hora[6]="00:00";
hora[7]="00:00";
while(dia < 10){ //aqui será definido um intervalo de datas
result[i] = dia+"/1/2018"+hora[i];
System.out.println(result[i]);
dia++;
}
}
After getting this method to work, I'll store it in% w / o as%:
entrada saida
1/1/2018 23:00 2/1/2018 06:00
2/1/2018 23:00 3/1/2018 06:00
3/1/2018 23:00 4/1/2018 06:00
5/1/2018 00:00 5/1/2018 00:00
6/1/2018 23:00 7/1/2018 06:00
7/1/2018 23:00 8/1/2018 06:00
8/1/2018 23:00 9/1/2018 06:00
10/1/2018 00:00 10/1/2018 00:00
11/1/2018 23:00 12/1/2018 06:00