
com.jamieswhiteshirt.rtree3i.MinimalVolumeIncreaseSelector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rtree-3i-lite Show documentation
Show all versions of rtree-3i-lite Show documentation
Immutable map applying a spatial index to keys based on R-Trees
The newest version!
package com.jamieswhiteshirt.rtree3i;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/**
* A selector that selects the node which has the minimal amount of increase in volume on insertion.
*/
public final class MinimalVolumeIncreaseSelector implements Selector {
@Override
public Node select(Box box, List> nodes) {
Comparator boxComparator = Comparators.volumeIncreaseComparator(box).thenComparing(Comparators.volumeComparator(box));
return Collections.min(nodes, Comparator.comparing(Node::getBox, boxComparator));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy