Class OnePassBucketizer
java.lang.Object
com.ggalmazor.downsampling.lttb.OnePassBucketizer
Utility class that divides the input list of
Point points into Bucket buckets
as required by the LTTB algorithm.
The first and last buckets always contain a single point (the first and last of the input).
Two strategies are supported; see BucketizationStrategy.
-
Method Summary
Modifier and TypeMethodDescriptionReturns buckets frominputusing the count-based (DYNAMIC) strategy.bucketize(List<T> input, int inputSize, int desiredBuckets, BucketizationStrategy strategy) Returns buckets frominputusing the specifiedBucketizationStrategy.
-
Method Details
-
bucketize
public static <T extends Point> List<Bucket<T>> bucketize(List<T> input, int inputSize, int desiredBuckets) Returns buckets frominputusing the count-based (DYNAMIC) strategy.- Type Parameters:
T- the type of thePointpoints- Parameters:
input- the input list of pointsinputSize- the size of the input listdesiredBuckets- the desired middle bucket count- Returns:
- the list of buckets
-
bucketize
public static <T extends Point> List<Bucket<T>> bucketize(List<T> input, int inputSize, int desiredBuckets, BucketizationStrategy strategy) Returns buckets frominputusing the specifiedBucketizationStrategy.- Type Parameters:
T- the type of thePointpoints- Parameters:
input- the input list of pointsinputSize- the size of the input listdesiredBuckets- the desired middle bucket countstrategy- the bucketization strategy to use- Returns:
- the list of buckets
-