I have some logic issue in Couchbase Lite. Here is my db data like below
"3 step", 50.00, 4, "step"
"3 step", 50.00, 3, "step"
"3 step", 50.00, 3, "step"
"3 step", 50.00, 4, "step"
"3 step", 50.00, 7, "step"
"3 step", 50.00, 2, "step"
"3 step", 50.00, 2, "step"
"3 step", 50.00, 1, "step"
"3 step", 50.00, 2, "step"
"3 step", 50.00, 3, "step"
4,3,3,4,7 this single step of the day 4 is a start step 7 is a end step.
which ever > than 5 is end step very next one is start step how can i can get only start step and end step value?
i tried with like below
while (rowEnum.hasNext()) {
Document gpsData = rowEnum.next().getDocument();
int stepDiff = (int) gpsData.getProperty("stepdiff");
if (start){
startStepArray.add((String) gData.getProperty("stepsDiff"));
start = false;
}
if (diffTime > 5) {
endStepArray.add((String) gData.getProperty("stepsDiff"));
start = true;
}
}
But this logic will not work if there is no >5
can some one guide me how can i achieve this?