Class RunningSumPoint

Object
RunningSumPoint

public final class RunningSumPoint extends Object
A running sum for tracking points separately in each dimension.
Author:
Owen Feehan
  • Constructor Details

    • RunningSumPoint

      public RunningSumPoint()
  • Method Details

    • increment

      public void increment(Point2i point)
      Increments the running-sum by a Point2i.

      No impact occurs on the third-dimension of the running-sum.

      Parameters:
      point - the point to add to the running sum.
    • increment

      public void increment(Point2d point)
      Increments the running-sum by a Point2d.

      No impact occurs on the third-dimension of the running-sum.

      Parameters:
      point - the point to add to the running sum.
    • increment

      public void increment(Point3i point)
      Increments the running-sum by a Point3i.
      Parameters:
      point - the point to add to the running sum.
    • increment

      public void increment(Point3d point)
      Increments the running-sum by a Point3d.
      Parameters:
      point - the point to add to the running sum.
    • mean

      public Point3d mean()
      The mean value of all points added to the running-sum, separately for all three-dimensions.
      Returns:
      a newly created point, with the mean for each dimension.
    • meanXY

      public Point2d meanXY()
      The mean value of all points added to the running-sum, only for the X- and Y-dimensions.
      Returns:
      a newly created point, with the mean for X- and Y- dimensions.
    • countXY

      public long countXY()
      The count for the X or Y dimensions.

      The count is guaranteed to always be the same for either the X or Y dimension.

      Returns:
      the count.
    • countZ

      public long countZ()
      The count for the Z dimension.

      This is identical to countXY() if only 3D points have been added.

      Returns:
      the count.