public MapNode nextStop(){
  MapNode next=stops.get(index);
  if (comingBack) {
    index--;
  }
 else {
    index++;
  }
  if (index < 0) {
    comingBack=false;
    index=1;
  }
  if (index >= stops.size()) {
    if (type == PINGPONG) {
      comingBack=true;
      index=stops.size() - 1;
    }
 else {
      index=0;
    }
  }
  return next;
}

public MapNode nextStop ( ) { MapNode next = stops . get ( index ) ; if ( comingBack ) { index -- ; } else { index ++ ; } if ( index < 0 ) { comingBack = false ; index = 1 ; } if ( index >= stops . size ( ) ) { if ( type == PINGPONG ) { comingBack = true ; index = stops . size ( ) - 1 ; } else { index = 0 ; } } return next ; }
returns the next stop on the route ( depending on the route mode )
