Package com.day.cq.search.facets.buckets
Class ValueRangeBucket
- java.lang.Object
-
- com.day.cq.search.facets.buckets.SimpleBucket
-
- com.day.cq.search.facets.buckets.PredefinedBucket
-
- com.day.cq.search.facets.buckets.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 Summary
Constructors Constructor Description ValueRangeBucket(java.lang.String name, java.lang.Comparable from, boolean fromIncluded, java.lang.Comparable to, boolean toIncluded, Predicate predicate)Creates an interval matching bucket.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptValue(javax.jcr.Value value)Accepts thevalueand increments the counter of this bucket if thevaluematches this buckets definition.java.lang.ComparablegetFrom()java.lang.ComparablegetTo()-
Methods inherited from class com.day.cq.search.facets.buckets.SimpleBucket
getCount, getPredicate, getValue, increment
-
-
-
-
Constructor Detail
-
ValueRangeBucket
public ValueRangeBucket(java.lang.String name, java.lang.Comparable from, boolean fromIncluded, java.lang.Comparable to, boolean toIncluded, Predicate predicate)Creates an interval matching bucket.- Parameters:
name- name of this bucket (for display)from- lower end of intervalfromIncluded- iftrue, will include the from value in the interval, ie. use>=to- upper end of intervaltoIncluded- iftrue, will include the to value in the interval, ie. use<=predicate- the predicate representing this bucket
-
-
Method Detail
-
getFrom
public java.lang.Comparable getFrom()
- Returns:
- the lower bound or
nullif none is set.
-
getTo
public java.lang.Comparable getTo()
- Returns:
- the upper bound or
nullif none is set.
-
acceptValue
public void acceptValue(javax.jcr.Value value) throws javax.jcr.RepositoryExceptionAccepts thevalueand increments the counter of this bucket if thevaluematches this buckets definition.- Specified by:
acceptValuein classPredefinedBucket- Parameters:
value- the value to accept.- Throws:
javax.jcr.RepositoryException- if an error occurs while reading from the repository.
-
-