From 2ca455404e1f9cdeb62991b629b32df3d1fdc8ae Mon Sep 17 00:00:00 2001 From: Jon Herrmann Date: Mon, 29 Oct 2018 12:20:26 +0100 Subject: [PATCH] Default impl. for HashingSegmentHandler --- .../etf/bsxm/topox/HashingSegmentHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/interactive_instruments/etf/bsxm/topox/HashingSegmentHandler.java b/src/main/java/de/interactive_instruments/etf/bsxm/topox/HashingSegmentHandler.java index 773d46a..11373f6 100644 --- a/src/main/java/de/interactive_instruments/etf/bsxm/topox/HashingSegmentHandler.java +++ b/src/main/java/de/interactive_instruments/etf/bsxm/topox/HashingSegmentHandler.java @@ -24,7 +24,11 @@ public interface HashingSegmentHandler { void coordinate2d(final double x, final double y, final long hash, final long location, final int type); - void coordinates2d(final double[] coordinates, final long hashesAndLocations[], final int type); + default void coordinates2d(final double[] coordinates, final long hashesAndLocations[], final int type) { + for (int i = 0; i < coordinates.length; i += 2) { + coordinate2d(coordinates[i], coordinates[i + 1], hashesAndLocations[i], hashesAndLocations[i + 1], type); + } + } void nextGeometricObject(); }