diff --git a/spatial-partition/src/main/java/com/iluwatar/spatialpartition/App.java b/spatial-partition/src/main/java/com/iluwatar/spatialpartition/App.java index 547392bb5671..e7b14249a732 100644 --- a/spatial-partition/src/main/java/com/iluwatar/spatialpartition/App.java +++ b/spatial-partition/src/main/java/com/iluwatar/spatialpartition/App.java @@ -60,7 +60,6 @@ @Slf4j public class App { - private static final String BUBBLE = "Bubble "; static void noSpatialPartition(int numOfMovements, Map bubbles) { //all bubbles have to be checked for collision for all bubbles diff --git a/spatial-partition/src/main/java/com/iluwatar/spatialpartition/QuadTree.java b/spatial-partition/src/main/java/com/iluwatar/spatialpartition/QuadTree.java index 12a84f5a33e9..40c09a1d8f6e 100644 --- a/spatial-partition/src/main/java/com/iluwatar/spatialpartition/QuadTree.java +++ b/spatial-partition/src/main/java/com/iluwatar/spatialpartition/QuadTree.java @@ -25,7 +25,8 @@ package com.iluwatar.spatialpartition; import java.util.Collection; -import java.util.Hashtable; +import java.util.HashMap; +import java.util.Map; /** * The quadtree data structure is being used to keep track of the objects' locations. It has the @@ -37,7 +38,7 @@ public class QuadTree { Rect boundary; int capacity; boolean divided; - Hashtable points; + Map points; QuadTree northwest; QuadTree northeast; QuadTree southwest; @@ -47,7 +48,7 @@ public class QuadTree { this.boundary = boundary; this.capacity = capacity; this.divided = false; - this.points = new Hashtable<>(); + this.points = new HashMap<>(); this.northwest = null; this.northeast = null; this.southwest = null; diff --git a/spatial-partition/src/main/java/com/iluwatar/spatialpartition/SpatialPartitionBubbles.java b/spatial-partition/src/main/java/com/iluwatar/spatialpartition/SpatialPartitionBubbles.java index 263ebb623a8c..3551f5ca3b9b 100644 --- a/spatial-partition/src/main/java/com/iluwatar/spatialpartition/SpatialPartitionBubbles.java +++ b/spatial-partition/src/main/java/com/iluwatar/spatialpartition/SpatialPartitionBubbles.java @@ -25,7 +25,6 @@ package com.iluwatar.spatialpartition; import java.util.ArrayList; -import java.util.HashMap; import java.util.Map; /** diff --git a/spatial-partition/src/main/java/com/iluwatar/spatialpartition/SpatialPartitionGeneric.java b/spatial-partition/src/main/java/com/iluwatar/spatialpartition/SpatialPartitionGeneric.java index c1eb8d1f3600..7c03969a08e6 100644 --- a/spatial-partition/src/main/java/com/iluwatar/spatialpartition/SpatialPartitionGeneric.java +++ b/spatial-partition/src/main/java/com/iluwatar/spatialpartition/SpatialPartitionGeneric.java @@ -24,7 +24,7 @@ */ package com.iluwatar.spatialpartition; -import java.util.Hashtable; +import java.util.Map; /** * This abstract class has 2 fields, one of which is a hashtable containing all objects that @@ -35,7 +35,7 @@ public abstract class SpatialPartitionGeneric { - Hashtable playerPositions; + Map playerPositions; QuadTree quadTree; /**