Enum Class BucketizationStrategy
- All Implemented Interfaces:
Serializable,Comparable<BucketizationStrategy>,Constable
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, so bucket x-span varies with data density. - Use
FIXEDwhen samples are unevenly distributed, or when there are gaps in the series. Each bucket covers the same x-span, so bucket point count varies with data density. Empty buckets (x-intervals with no points) are silently skipped; the output may therefore have fewer thandesiredBuckets + 2points.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic BucketizationStrategyReturns the enum constant of this class with the specified name.static BucketizationStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DYNAMIC
Dynamic bucket size: each bucket contains an equal number of points.This is the default strategy, corresponding to the dynamic bucket size variant in the original LTTB paper. It works well when samples are evenly distributed across the x-axis, where equal point counts correspond to equal x-spans.
Requires at least
desiredBuckets + 2points in the input. ThrowsIllegalArgumentExceptionif the input is too small. -
FIXED
Fixed bucket size: each bucket covers an equal x-axis span.Corresponds to the fixed bucket size variant in the original LTTB paper. The total x range
[x_first, x_last]is divided intodesiredBucketsequal-width intervals. Each point is assigned to the interval that contains itsPoint.x()value. This works correctly whetherx()represents timestamps, plain numeric indices, or any other monotonically increasing dimension.X-intervals that contain no points are silently skipped. As a result, the output may contain fewer than
desiredBuckets + 2points when the input has gaps or highly uneven density.Point.x()must be monotonically non-decreasing across the input list.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-