[Spatial Partition] (Fix) Issue #2544: Can not run App.java & some logs are wrong (#2545)

* [Spatial Partition] (Fix) Issue #2544

- ConcurrentModificationException
- Wrong log
- Log using formatting anchor

* [Spatial Partition] (Change) Hashtable to Map, (Remove) unused variable BUBBLE
This commit is contained in:
Tien Nguyen Minh
2023-08-20 14:28:05 +07:00
committed by GitHub
parent c769c73e91
commit 2154e777b6
6 changed files with 27 additions and 28 deletions
@@ -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<Integer, Point> points;
Map<Integer, Point> 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;