InstanceState state = new InstanceState(serviceDate.getTime(), frequency);
switch (frequencyBehavior) {
case INCLUDE_UNSPECIFIED: {
stopTimeInstances.add(new StopTimeInstance(bst, state));
offsetsIntoIndex.add(in);
break;
}
case INCLUDE_INTERPOLATED: {
int stopTimeOffset = entry.getStopTimeOffset();
int tFrom = Math.max(relativeFrom, frequency.getStartTime());
int tTo = Math.min(relativeTo, frequency.getEndTime());
tFrom = snapToFrequencyStopTime(frequency, tFrom, stopTimeOffset,
true);
tTo = snapToFrequencyStopTime(frequency, tTo, stopTimeOffset, false);
for (int t = tFrom; t <= tTo; t += frequency.getHeadwaySecs()) {
int frequencyOffset = t - bst.getStopTime().getDepartureTime();
stopTimeInstances.add(new StopTimeInstance(bst, state,
frequencyOffset));
offsetsIntoIndex.add(in);
}
break;
}