Class IntervalTree.Node<V extends Interval>

java.lang.Object
net.buildtheearth.terraminusminus.util.interval.IntervalTree.Node<V>
All Implemented Interfaces:
Interval
Enclosing class:
IntervalTree<V extends Interval>

protected static final class IntervalTree.Node<V extends Interval> extends Object
A node in the segment tree (either a leaf or internal node).
  • Field Details

    • children

      protected IntervalTree.Node<V extends Interval>[] children
    • values

      protected Object[] values
    • size

      protected int size
    • min

      protected final double min
    • max

      protected final double max
  • Constructor Details

    • Node

      public Node(double min, double max)
  • Method Details

    • insert

      protected void insert(V value)
    • split

      protected void split()
    • forEachIntersecting

      protected void forEachIntersecting(double point, Consumer<V> callback)
    • forEach

      protected void forEach(Consumer<V> callback)
    • canSplit

      protected boolean canSplit()
      Returns:
      whether or not this node's contents are allowed to be split into children when it overflows
    • childIndex

      protected int childIndex(Interval interval)
    • cleanup

      protected void cleanup()
    • createChild

      protected IntervalTree.Node<V> createChild(int childIndex)
    • min

      public double min()
      Specified by:
      min in interface Interval
      Returns:
      the minimum coordinate
    • max

      public double max()
      Specified by:
      max in interface Interval
      Returns:
      the maximum coordinate
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object