From 3600752c4384666b0d90de8503758b2dc5d85751 Mon Sep 17 00:00:00 2001 From: Mikael Capelle Date: Mon, 5 Mar 2018 17:55:32 +0100 Subject: [PATCH] Clean code, remove remaining debug attribute. --- .../org/insa/graph/AccessRestrictions.java | 28 +++++++++++-------- .../insa/graph/{Arc.java => ArcForward.java} | 0 2 files changed, 17 insertions(+), 11 deletions(-) rename src/main/org/insa/graph/{Arc.java => ArcForward.java} (100%) diff --git a/src/main/org/insa/graph/AccessRestrictions.java b/src/main/org/insa/graph/AccessRestrictions.java index 6bc55b3..1ff65ae 100644 --- a/src/main/org/insa/graph/AccessRestrictions.java +++ b/src/main/org/insa/graph/AccessRestrictions.java @@ -8,7 +8,14 @@ public class AccessRestrictions { public enum AccessMode { // Specific modes - FOOT, BICYCLE, SMALL_MOTORCYCLE, AGRICULTURAL, MOTORCYCLE, MOTORCAR, HEAVY_GOODS, PUBLIC_TRANSPORT; + FOOT, + BICYCLE, + SMALL_MOTORCYCLE, + AGRICULTURAL, + MOTORCYCLE, + MOTORCAR, + HEAVY_GOODS, + PUBLIC_TRANSPORT; // All available modes public static final EnumSet ALL = EnumSet.allOf(AccessMode.class); @@ -18,16 +25,17 @@ public class AccessRestrictions { AccessMode.PUBLIC_TRANSPORT); // Motor vehicle - public static final EnumSet MOTOR_VEHICLE = EnumSet.range(AccessMode.SMALL_MOTORCYCLE, - AccessMode.PUBLIC_TRANSPORT); + public static final EnumSet MOTOR_VEHICLE = EnumSet + .range(AccessMode.SMALL_MOTORCYCLE, AccessMode.PUBLIC_TRANSPORT); } public enum AccessRestriction { ALLOWED, FORBIDDEN, PRIVATE, DESTINATION, DELIVERY, CUSTOMERS, FORESTRY, UNKNOWN; // Not private or forbidden - public static final EnumSet ALLOWED_FOR_SOMETHING = EnumSet.of(AccessRestriction.ALLOWED, - AccessRestriction.DESTINATION, AccessRestriction.DESTINATION, AccessRestriction.DELIVERY, + public static final EnumSet ALLOWED_FOR_SOMETHING = EnumSet.of( + AccessRestriction.ALLOWED, AccessRestriction.DESTINATION, + AccessRestriction.DESTINATION, AccessRestriction.DELIVERY, AccessRestriction.CUSTOMERS, AccessRestriction.FORESTRY); } @@ -45,16 +53,13 @@ public class AccessRestrictions { } } - public long value = 0; - /** * Create a new instance of access restrictions with the given restrictions. * * @param restrictions */ - public AccessRestrictions(EnumMap restrictions, long value) { + public AccessRestrictions(EnumMap restrictions) { this.restrictions = restrictions; - this.value = value; } /** @@ -91,9 +96,10 @@ public class AccessRestrictions { * @param restrictions * * @return true if all the given modes are allowed for any of the given - * restrictions. + * restrictions. */ - public boolean areAllAllowedForAny(EnumSet modes, EnumSet restrictions) { + public boolean areAllAllowedForAny(EnumSet modes, + EnumSet restrictions) { boolean allowed = true; for (AccessMode mode: modes) { allowed = allowed && isAllowedForAny(mode, restrictions); diff --git a/src/main/org/insa/graph/Arc.java b/src/main/org/insa/graph/ArcForward.java similarity index 100% rename from src/main/org/insa/graph/Arc.java rename to src/main/org/insa/graph/ArcForward.java