From 4b36838b26258b8623746b913d5a26955474d4e8 Mon Sep 17 00:00:00 2001 From: Holt59 Date: Mon, 5 Mar 2018 21:44:41 +0100 Subject: [PATCH] Clean code. --- src/main/org/insa/graph/Node.java | 2 ++ src/main/org/insa/graph/Point.java | 3 ++- src/main/org/insa/graph/io/BinaryGraphReaderInsa2018.java | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/org/insa/graph/Node.java b/src/main/org/insa/graph/Node.java index f324e6a..6a93bdc 100644 --- a/src/main/org/insa/graph/Node.java +++ b/src/main/org/insa/graph/Node.java @@ -59,6 +59,7 @@ public class Node implements Comparable { /* * (non-Javadoc) + * * @see java.lang.Object#equals(java.lang.Object) */ @Override @@ -71,6 +72,7 @@ public class Node implements Comparable { /* * (non-Javadoc) + * * @see java.lang.Comparable#compareTo(java.lang.Object) */ @Override diff --git a/src/main/org/insa/graph/Point.java b/src/main/org/insa/graph/Point.java index f5920f4..6a0db35 100644 --- a/src/main/org/insa/graph/Point.java +++ b/src/main/org/insa/graph/Point.java @@ -4,7 +4,7 @@ package org.insa.graph; * Class representing a point on Earth. * */ -public class Point { +public final class Point { // Earth radius, in meters; private static final double EARTH_RADIUS = 6378137.0; @@ -65,6 +65,7 @@ public class Point { /* * (non-Javadoc) + * * @see java.lang.Object#toString() */ @Override diff --git a/src/main/org/insa/graph/io/BinaryGraphReaderInsa2018.java b/src/main/org/insa/graph/io/BinaryGraphReaderInsa2018.java index 46ec02e..eb3eea5 100644 --- a/src/main/org/insa/graph/io/BinaryGraphReaderInsa2018.java +++ b/src/main/org/insa/graph/io/BinaryGraphReaderInsa2018.java @@ -8,8 +8,8 @@ import java.util.EnumMap; import org.insa.graph.AccessRestrictions; import org.insa.graph.AccessRestrictions.AccessMode; import org.insa.graph.AccessRestrictions.AccessRestriction; -import org.insa.graph.ArcForward; import org.insa.graph.ArcBackward; +import org.insa.graph.ArcForward; import org.insa.graph.Graph; import org.insa.graph.GraphInformation; import org.insa.graph.Node; @@ -41,7 +41,7 @@ public class BinaryGraphReaderInsa2018 extends BinaryReader implements GraphRead // the order correspond to the 4 bits value (i.e. FORBIDDEN is 0 or PRIVATE is // 2) - UKNOWN is not included because value above 6 (FORESTRY) are all // considered unknown. - final AccessRestriction[] allRestrictions = new AccessRestriction[]{ + final AccessRestriction[] allRestrictions = new AccessRestriction[] { AccessRestriction.FORBIDDEN, AccessRestriction.ALLOWED, AccessRestriction.PRIVATE, AccessRestriction.DESTINATION, AccessRestriction.DELIVERY, AccessRestriction.CUSTOMERS, AccessRestriction.FORESTRY }; @@ -49,7 +49,7 @@ public class BinaryGraphReaderInsa2018 extends BinaryReader implements GraphRead // The order of values inside this array is VERY IMPORTANT: The order is such // that each 4-bits group of the long value is processed in the correct order, // i.e. FOOT is processed first (4 lowest bits), and so on. - final AccessMode[] allModes = new AccessMode[]{ AccessMode.FOOT, null, AccessMode.BICYCLE, + final AccessMode[] allModes = new AccessMode[] { AccessMode.FOOT, null, AccessMode.BICYCLE, AccessMode.SMALL_MOTORCYCLE, AccessMode.AGRICULTURAL, AccessMode.MOTORCYCLE, AccessMode.MOTORCAR, AccessMode.HEAVY_GOODS, null, AccessMode.PUBLIC_TRANSPORT };