private void getStreetLegBuilderAsLeg(List<State> streetStates,
TraverseMode mode, List<LegBean> legs) {
List<StreetLegBean> streetLegs = new ArrayList<StreetLegBean>();
StreetLegBean streetLeg = null;
List<CoordinatePoint> path = new ArrayList<CoordinatePoint>();
double distance = 0.0;
double totalDistance = 0.0;
long startTime = 0;
long endTime = 0;
CoordinatePoint from = null;
CoordinatePoint to = null;
for (State state : streetStates) {
EdgeNarrative edgeResult = state.getBackEdgeNarrative();
Geometry geom = edgeResult.getGeometry();
if (geom == null) {
continue;
}
String streetName = edgeResult.getName();
if (streetLeg == null
|| !ObjectUtils.equals(streetLeg.getStreetName(), streetName)) {
addPathToStreetLegIfApplicable(streetLeg, path, distance);
streetLeg = createStreetLeg(state);
streetLegs.add(streetLeg);