Interface Point

All Known Implementing Classes:
DoublePoint

public interface Point
Defines the properties of points that can be processed by LTThreeBuckets.

Users of this library must use DoublePoint or implement their own subtypes of this interface.

  • Method Summary

    Modifier and Type
    Method
    Description
    Computes the geometric center point of the segment linking the provided a and b points.
    double
    x()
    Returns the x (horizontal / time) value of this point.
    double
    y()
    Returns the y (vertical / value) value of this point.
  • Method Details

    • centerBetween

      static DoublePoint centerBetween(Point a, Point b)
      Computes the geometric center point of the segment linking the provided a and b points.
      Parameters:
      a - the first point of the segment
      b - the second point of the segment
      Returns:
      a DoublePoint in the geometric center between the two provided points
    • x

      double x()
      Returns the x (horizontal / time) value of this point.

      Contract: x() must be monotonically non-decreasing across a sorted input list — i.e. for any two consecutive points a and b in the list passed to LTThreeBuckets.sorted(List, int), a.x() <= b.x() must hold. The algorithm does not verify this; violating it produces undefined output.

      This contract is also required for fixed-size bucketization (BucketizationStrategy.FIXED), where x() is used to compute equal-width x-span intervals. Non-monotonic or unordered x() values will produce incorrect bucket assignments.

      Returns:
      the x (horizontal / time) value of this point
    • y

      double y()
      Returns the y (vertical / value) value of this point.
      Returns:
      the y (vertical / value) value of this point