Enum Class BucketizationStrategy

java.lang.Object
java.lang.Enum<BucketizationStrategy>
com.ggalmazor.downsampling.lttb.BucketizationStrategy
All Implemented Interfaces:
Serializable, Comparable<BucketizationStrategy>, Constable

public enum BucketizationStrategy extends Enum<BucketizationStrategy>
Selects the bucket-size strategy used to divide the input series before the LTTB triangle-selection step.

These strategies correspond directly to the dynamic and fixed bucket sizes described in the original LTTB paper: Downsampling Time Series for Visual Representation by Sveinn Steinarsson (2013).

  • Use DYNAMIC (the default) when samples are evenly distributed across the x-axis. Each bucket contains the same number of points.
  • Use FIXED when samples are unevenly distributed or when there are gaps. Each bucket covers the same x-span. Empty buckets are silently skipped; the output may therefore have fewer than buckets + 2 points.
  • Enum Constant Details

    • DYNAMIC

      public static final BucketizationStrategy DYNAMIC
      Dynamic bucket size: each bucket contains an equal number of points.

      This is the default strategy. Throws IllegalArgumentException if the input does not contain enough points for the requested bucket count.

    • FIXED

      public static final BucketizationStrategy FIXED
      Fixed bucket size: each bucket covers an equal x-axis span.

      The total x range [x_first, x_last] is divided into equal-width intervals. Empty intervals are silently skipped. Point.x() must be monotonically non-decreasing across the input list.

  • Method Details

    • values

      public static BucketizationStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BucketizationStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null