Class OnePassBucketizer

java.lang.Object
com.ggalmazor.downsampling.lttb.OnePassBucketizer

public class OnePassBucketizer extends Object
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 Details

    • bucketize

      public static <T extends Point> List<Bucket<T>> bucketize(List<T> input, int inputSize, int desiredBuckets)
      Returns buckets from input using the count-based (DYNAMIC) strategy.
      Type Parameters:
      T - the type of the Point points
      Parameters:
      input - the input list of points
      inputSize - the size of the input list
      desiredBuckets - 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 from input using the specified BucketizationStrategy.
      Type Parameters:
      T - the type of the Point points
      Parameters:
      input - the input list of points
      inputSize - the size of the input list
      desiredBuckets - the desired middle bucket count
      strategy - the bucketization strategy to use
      Returns:
      the list of buckets