From 075746652dc0d8938c2bd74e8059f3b248bc9aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Proch=C3=A1zka?= <david@prochazka.dev> Date: Fri, 23 Apr 2021 19:41:02 +0200 Subject: [PATCH] ADD: overrides --- src/mhtree/InternalNode.java | 5 +++++ src/mhtree/LeafNode.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/mhtree/InternalNode.java b/src/mhtree/InternalNode.java index 7269dcc..6551335 100644 --- a/src/mhtree/InternalNode.java +++ b/src/mhtree/InternalNode.java @@ -56,6 +56,7 @@ class InternalNode extends Node implements Serializable { * * @param object object to be added */ + @Override protected void addObject(LocalAbstractObject object) { addObjectIntoHull(object); } @@ -65,6 +66,7 @@ class InternalNode extends Node implements Serializable { * * @return the list of objects stored in node's descendants */ + @Override protected List<LocalAbstractObject> getObjects() { return children .stream() @@ -78,6 +80,7 @@ class InternalNode extends Node implements Serializable { * * @return the height of this node */ + @Override protected int getHeight() { return children .stream() @@ -91,6 +94,7 @@ class InternalNode extends Node implements Serializable { * * @param nodes list of nodes */ + @Override protected void gatherNodes(List<Node> nodes) { nodes.add(this); children.forEach(child -> child.gatherNodes(nodes)); @@ -101,6 +105,7 @@ class InternalNode extends Node implements Serializable { * * @param leafNodes list of leaf nodes */ + @Override protected void gatherLeafNodes(List<LeafNode> leafNodes) { children.forEach(child -> child.gatherLeafNodes(leafNodes)); } diff --git a/src/mhtree/LeafNode.java b/src/mhtree/LeafNode.java index ff267de..9cad0e9 100644 --- a/src/mhtree/LeafNode.java +++ b/src/mhtree/LeafNode.java @@ -38,6 +38,7 @@ public class LeafNode extends Node implements Serializable { * @param object object to be added * @throws BucketStorageException addition of object into bucket exception */ + @Override protected void addObject(LocalAbstractObject object) throws BucketStorageException { bucket.addObject(object); addObjectIntoHull(object); @@ -48,6 +49,7 @@ public class LeafNode extends Node implements Serializable { * * @return a list of objects in node's bucket */ + @Override public List<LocalAbstractObject> getObjects() { List<LocalAbstractObject> objects = new ArrayList<>(bucket.getObjectCount()); @@ -72,6 +74,7 @@ public class LeafNode extends Node implements Serializable { * * @return the height of this node */ + @Override protected int getHeight() { return 0; } @@ -81,6 +84,7 @@ public class LeafNode extends Node implements Serializable { * * @param nodes list of nodes */ + @Override protected void gatherNodes(List<Node> nodes) { nodes.add(this); } @@ -90,6 +94,7 @@ public class LeafNode extends Node implements Serializable { * * @param leafNodes list of leaf nodes */ + @Override protected void gatherLeafNodes(List<LeafNode> leafNodes) { leafNodes.add(this); } -- GitLab