Formatting

This commit is contained in:
Roman Inflianskas 2016-07-02 14:19:27 +03:00
parent 28956f8ad5
commit e5fe0d9eb7

View file

@ -44,9 +44,11 @@ public class BinaryRoutePlanner {
private static class SegmentsComparator implements Comparator<RouteSegment> { private static class SegmentsComparator implements Comparator<RouteSegment> {
final RoutingContext ctx; final RoutingContext ctx;
public SegmentsComparator(RoutingContext ctx) { public SegmentsComparator(RoutingContext ctx) {
this.ctx = ctx; this.ctx = ctx;
} }
@Override @Override
public int compare(RouteSegment o1, RouteSegment o2) { public int compare(RouteSegment o1, RouteSegment o2) {
return ctx.roadPriorityComparator(o1.distanceFromStart, o1.distanceToEnd, o2.distanceFromStart, o2.distanceToEnd); return ctx.roadPriorityComparator(o1.distanceFromStart, o1.distanceToEnd, o2.distanceFromStart, o2.distanceToEnd);
@ -56,11 +58,13 @@ public class BinaryRoutePlanner {
private static class NonHeuristicSegmentsComparator implements Comparator<RouteSegment> { private static class NonHeuristicSegmentsComparator implements Comparator<RouteSegment> {
public NonHeuristicSegmentsComparator() { public NonHeuristicSegmentsComparator() {
} }
@Override @Override
public int compare(RouteSegment o1, RouteSegment o2) { public int compare(RouteSegment o1, RouteSegment o2) {
return roadPriorityComparator(o1.distanceFromStart, o1.distanceToEnd, o2.distanceFromStart, o2.distanceToEnd, 0.5); return roadPriorityComparator(o1.distanceFromStart, o1.distanceToEnd, o2.distanceFromStart, o2.distanceToEnd, 0.5);
} }
} }
/** /**
* Calculate route between start.segmentEnd and end.segmentStart (using A* algorithm) * Calculate route between start.segmentEnd and end.segmentStart (using A* algorithm)
* return list of segments * return list of segments
@ -354,7 +358,6 @@ public class BinaryRoutePlanner {
} }
private static void println(String logMsg) { private static void println(String logMsg) {
// log.info(logMsg); // log.info(logMsg);
System.out.println(logMsg); System.out.println(logMsg);
@ -696,8 +699,6 @@ public class BinaryRoutePlanner {
} }
private RouteSegment processIntersections(RoutingContext ctx, PriorityQueue<RouteSegment> graphSegments, private RouteSegment processIntersections(RoutingContext ctx, PriorityQueue<RouteSegment> graphSegments,
TLongObjectHashMap<RouteSegment> visitedSegments, float distFromStart, RouteSegment segment, TLongObjectHashMap<RouteSegment> visitedSegments, float distFromStart, RouteSegment segment,
short segmentPoint, RouteSegment inputNext, boolean reverseWaySearch, boolean doNotAddIntersections, short segmentPoint, RouteSegment inputNext, boolean reverseWaySearch, boolean doNotAddIntersections,
@ -950,6 +951,7 @@ public class BinaryRoutePlanner {
public Iterator<RouteSegment> getIterator() { public Iterator<RouteSegment> getIterator() {
return new Iterator<BinaryRoutePlanner.RouteSegment>() { return new Iterator<BinaryRoutePlanner.RouteSegment>() {
RouteSegment next = RouteSegment.this; RouteSegment next = RouteSegment.this;
@Override @Override
public void remove() { public void remove() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();