Date fromDate = nextDate( date );
Date toDate = nextDate( fromDate );
date = nextDate( toDate );
transitEdges.add( new TransitEdge(
dao.getVoyageNumber( originUnLocode, firstLegTo ),
originUnLocode, firstLegTo, fromDate, toDate ) );
for( int j = 0; j < allVertices.size() - 1; j++ )
{
final String curr = allVertices.get( j );
final String next = allVertices.get( j + 1 );
fromDate = nextDate( date );
toDate = nextDate( fromDate );
date = nextDate( toDate );
transitEdges.add( new TransitEdge( dao.getVoyageNumber( curr, next ), curr, next, fromDate, toDate ) );
}
final String lastLegFrom = allVertices.get( allVertices.size() - 1 );
fromDate = nextDate( date );
toDate = nextDate( fromDate );
transitEdges.add( new TransitEdge(
dao.getVoyageNumber( lastLegFrom, destinationUnLocode ),
lastLegFrom, destinationUnLocode, fromDate, toDate ) );
candidates.add( new TransitPath( transitEdges ) );
}