Class ValueRangeBucket

All Implemented Interfaces:
Bucket

public class ValueRangeBucket extends PredefinedBucket
ValueRangeBucket is a bucket that stands for an interval of values.
Since:
5.2
  • Constructor Details

    • ValueRangeBucket

      public ValueRangeBucket(String name, Comparable from, boolean fromIncluded, Comparable to, boolean toIncluded, Predicate predicate)
      Creates an interval matching bucket.
      Parameters:
      name - name of this bucket (for display)
      from - lower end of interval
      fromIncluded - if true, will include the from value in the interval, ie. use >=
      to - upper end of interval
      toIncluded - if true, will include the to value in the interval, ie. use <=
      predicate - the predicate representing this bucket
  • Method Details

    • getFrom

      public Comparable getFrom()
      Returns:
      the lower bound or null if none is set.
    • getTo

      public Comparable getTo()
      Returns:
      the upper bound or null if none is set.
    • acceptValue

      public void acceptValue(Value value) throws RepositoryException
      Accepts the value and increments the counter of this bucket if the value matches this buckets definition.
      Specified by:
      acceptValue in class PredefinedBucket
      Parameters:
      value - the value to accept.
      Throws:
      RepositoryException - if an error occurs while reading from the repository.