From fd08b9491c08f5d1b867b77e51c55e59a7e77e6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Harrtell?= Date: Sun, 29 Oct 2017 19:04:03 +0100 Subject: [PATCH] Implement overrides make overload resolution more explicit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Harrtell --- .../jts/index/strtree/AbstractSTRtree.java | 4 ++-- .../org/locationtech/jts/index/strtree/SIRtree.java | 12 ++++++++++++ .../org/locationtech/jts/index/strtree/STRtree.java | 10 ++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/modules/core/src/main/java/org/locationtech/jts/index/strtree/AbstractSTRtree.java b/modules/core/src/main/java/org/locationtech/jts/index/strtree/AbstractSTRtree.java index 07898782b0..bc9de671a9 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/strtree/AbstractSTRtree.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/strtree/AbstractSTRtree.java @@ -274,7 +274,7 @@ protected void query(Object searchBounds, ItemVisitor visitor) { */ protected abstract IntersectsOp getIntersectsOp(); - private void query(Object searchBounds, AbstractNode node, List matches) { + protected void query(Object searchBounds, AbstractNode node, List matches) { List childBoundables = node.getChildBoundables(); for (int i = 0; i < childBoundables.size(); i++) { Boundable childBoundable = (Boundable) childBoundables.get(i); @@ -293,7 +293,7 @@ else if (childBoundable instanceof ItemBoundable) { } } - private void query(Object searchBounds, AbstractNode node, ItemVisitor visitor) { + protected void query(Object searchBounds, AbstractNode node, ItemVisitor visitor) { List childBoundables = node.getChildBoundables(); for (int i = 0; i < childBoundables.size(); i++) { Boundable childBoundable = (Boundable) childBoundables.get(i); diff --git a/modules/core/src/main/java/org/locationtech/jts/index/strtree/SIRtree.java b/modules/core/src/main/java/org/locationtech/jts/index/strtree/SIRtree.java index 3bcd076efe..8e55278707 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/strtree/SIRtree.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/strtree/SIRtree.java @@ -16,6 +16,8 @@ import java.util.Iterator; import java.util.List; +import org.locationtech.jts.index.ItemVisitor; + /** * One-dimensional version of an STR-packed R-tree. SIR stands for * "Sort-Interval-Recursive". STR-packed R-trees are described in: @@ -83,6 +85,16 @@ public void insert(double x1, double x2, Object item) { super.insert(new Interval(Math.min(x1, x2), Math.max(x1, x2)), item); } + @Override + protected void query(Object searchBounds, AbstractNode node, List matches) { + super.query(searchBounds, node, matches); + } + + @Override + protected void query(Object searchBounds, AbstractNode node, ItemVisitor visitor) { + super.query(searchBounds, node, visitor); + } + /** * Returns items whose bounds intersect the given value. */ diff --git a/modules/core/src/main/java/org/locationtech/jts/index/strtree/STRtree.java b/modules/core/src/main/java/org/locationtech/jts/index/strtree/STRtree.java index fd1258029e..abeb747d51 100644 --- a/modules/core/src/main/java/org/locationtech/jts/index/strtree/STRtree.java +++ b/modules/core/src/main/java/org/locationtech/jts/index/strtree/STRtree.java @@ -196,6 +196,16 @@ public void insert(Envelope itemEnv, Object item) { super.insert(itemEnv, item); } + @Override + protected void query(Object searchBounds, AbstractNode node, List matches) { + super.query(searchBounds, node, matches); + } + + @Override + protected void query(Object searchBounds, AbstractNode node, ItemVisitor visitor) { + super.query(searchBounds, node, visitor); + } + /** * Returns items whose bounds intersect the given envelope. */