All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.cq.social.srp.IntervalFacetRangeField Maven / Gradle / Ivy

/*************************************************************************
 *
 * ADOBE CONFIDENTIAL
 * __________________
 *
 *  Copyright 2016 Adobe Systems Incorporated
 *  All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 **************************************************************************/
package com.adobe.cq.social.srp;

import java.util.Date;

public class IntervalFacetRangeField extends FacetRangeField {

    protected Long[] gaps; // an array of the gap lengths between date intervals, measured in milliseconds

    public IntervalFacetRangeField(final String fieldName, final long start, final long end, final Long[] gaps) {
        throw new UnsupportedOperationException("facet search is not supported for numeric ranges with variable gaps");
        // At present, there is a use case we need to support for range facets using variable-length gaps on date
        // fields
        // If we ever have a need to support numeric fields, this method stub should be written. -- Mason Wolf
        // 6/30/2016
    }

    public IntervalFacetRangeField(final String fieldName, final Date startDate, final Date endDate, final Long[] gaps) {
        this.fieldName = fieldName;
        this.startDate = startDate;
        this.endDate = endDate;
        this.isDateRange = true;
        this.gaps = gaps;
        // Initialize to max, not used if date
        this.startValue = Integer.MAX_VALUE;
        this.endValue = Integer.MAX_VALUE;
        this.gapValue = Integer.MAX_VALUE;
    }

    public Long[] getGaps() {
        return gaps;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy