From b5168746bdbc8df3e6c0b6be229ff320bc55cfe3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Proch=C3=A1zka?= <david@prochazka.dev>
Date: Tue, 4 May 2021 21:11:49 +0200
Subject: [PATCH] FIX: improved java doc

---
 src/mhtree/MHTree.java | 18 +++++++++---------
 src/mhtree/Utils.java  |  2 ++
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/mhtree/MHTree.java b/src/mhtree/MHTree.java
index ae8d9b3..2ecf550 100644
--- a/src/mhtree/MHTree.java
+++ b/src/mhtree/MHTree.java
@@ -53,7 +53,7 @@ public class MHTree extends Algorithm implements Serializable {
         super("MH-Tree");
 
         leafCapacity = builder.leafCapacity;
-        arity = builder.nodeDegree;
+        arity = builder.arity;
 
         bucketDispatcher = builder.bucketDispatcher;
         insertType = builder.insertType;
@@ -235,7 +235,7 @@ public class MHTree extends Algorithm implements Serializable {
         /**
          * Maximal degree of internal node.
          */
-        private final int nodeDegree;
+        private final int arity;
 
         /**
          * Specifies which method to use when adding a new object.
@@ -253,17 +253,17 @@ public class MHTree extends Algorithm implements Serializable {
         private BucketDispatcher bucketDispatcher;
 
         /**
-         * Specifies how should the nodes be merged together.
+         * Specifies the merging strategy.
          */
         private MergeType mergeType;
 
         /**
-         * Precomputed objects distances.
+         * Precomputed object distances.
          */
         private AbstractRepresentation.PrecomputedDistances objectDistances;
 
         /**
-         * Stores leaf nodes and subsequently internal nodes.
+         * Stores intermediate nodes.
          */
         private Node[] nodes;
 
@@ -282,10 +282,10 @@ public class MHTree extends Algorithm implements Serializable {
          */
         private Node root;
 
-        public Builder(List<LocalAbstractObject> objects, int leafCapacity, int nodeDegree) {
+        public Builder(List<LocalAbstractObject> objects, int leafCapacity, int arity) {
             this.objects = objects;
             this.leafCapacity = leafCapacity;
-            this.nodeDegree = nodeDegree;
+            this.arity = arity;
 
             this.insertType = InsertType.GREEDY;
             this.objectToNodeDistance = ObjectToNodeDistance.NEAREST;
@@ -336,7 +336,7 @@ public class MHTree extends Algorithm implements Serializable {
 
             nodeDistances = new PrecomputedNodeDistances();
 
-            root = createRoot(nodeDegree);
+            root = createRoot(arity);
 
             objectDistances = null;
             System.gc();
@@ -393,7 +393,7 @@ public class MHTree extends Algorithm implements Serializable {
                 notProcessedObjectIndices.clear(furthestIndex);
                 objectIndices.add(furthestIndex);
 
-                // Select the rest of the objects up to the total of leafCapacity
+                // Select the rest of the objects up to the total of leafCapacity with respect to the building of a hull
                 objectIndices.addAll(findClosestItems(this::findClosestObjectIndex, furthestIndex, leafCapacity - 1, notProcessedObjectIndices));
 
                 List<LocalAbstractObject> objects = objectIndices
diff --git a/src/mhtree/Utils.java b/src/mhtree/Utils.java
index 65982f6..a2f5754 100644
--- a/src/mhtree/Utils.java
+++ b/src/mhtree/Utils.java
@@ -1,5 +1,7 @@
 package mhtree;
 
+import messif.objects.LocalAbstractObject;
+
 import java.util.BitSet;
 import java.util.function.BiPredicate;
 
-- 
GitLab