Class LTThreeBuckets
None of the methods in this class will mutate input lists or their elements.
-
Method Summary
Modifier and TypeMethodDescriptionReturns a downsampled version of the providedinputlist.Returns a downsampled version of the providedinputlist.sorted(List<T> input, int inputSize, int desiredBuckets, BucketizationStrategy strategy) Returns a downsampled version of the providedinputlist using the specifiedBucketizationStrategy.sorted(List<T> input, int desiredBuckets, BucketizationStrategy strategy) Returns a downsampled version of the providedinputlist using the specifiedBucketizationStrategy.
-
Method Details
-
sorted
Returns a downsampled version of the providedinputlist.Notes:
- The input list must be sorted.
- This method doesn't mutate the input list or any of its elements.
The output list will have
desiredBuckets + 2elements: one per bucket plus the first and last points of the original series. -
sorted
public static <T extends Point> List<T> sorted(List<T> input, int desiredBuckets, BucketizationStrategy strategy) Returns a downsampled version of the providedinputlist using the specifiedBucketizationStrategy.Notes:
- The input list must be sorted by
Point.x(). - This method doesn't mutate the input list or any of its elements.
When
BucketizationStrategy.FIXEDis used, empty x-intervals are skipped and the output may have fewer thandesiredBuckets + 2points. - The input list must be sorted by
-
sorted
Returns a downsampled version of the providedinputlist.Notes:
- The input list must be sorted.
- This method doesn't mutate the input list or any of its elements.
The output list will have
desiredBuckets + 2elements: one per bucket plus the first and last points of the original series.When the input contains
DoublePointinstances, an optimised struct-of-arrays path is used: x and y coordinates are extracted into contiguousdouble[]arrays before the selection loop, eliminating per-point pointer chasing in the hot path.When
desiredBucketsexceeds 512, the triangle-selection loop runs in parallel using the commonForkJoinPool. -
sorted
public static <T extends Point> List<T> sorted(List<T> input, int inputSize, int desiredBuckets, BucketizationStrategy strategy) Returns a downsampled version of the providedinputlist using the specifiedBucketizationStrategy.Notes:
- The input list must be sorted by
Point.x(). - This method doesn't mutate the input list or any of its elements.
When
BucketizationStrategy.FIXEDis used, empty x-intervals are skipped and the output may have fewer thandesiredBuckets + 2points.When the input contains
DoublePointinstances, an optimised struct-of-arrays path is used: x and y coordinates are extracted into contiguousdouble[]arrays before the selection loop, eliminating per-point pointer chasing in the hot path.When
desiredBucketsexceeds 512, the triangle-selection loop runs in parallel using the commonForkJoinPool.- Type Parameters:
T- the type of thePointelements in the input list- Parameters:
input- the input list ofPointpoints to downsampleinputSize- the size of the input listdesiredBuckets- the desired number of buckets for the downsampled output liststrategy- the bucketization strategy to use- Returns:
- the downsampled output list
- The input list must be sorted by
-