Examples of LongRange


Examples of org.apache.lucene.facet.range.LongRange

  /** User runs a query and counts facets. */
  public List<FacetResult> search() throws IOException {

    FacetSearchParams fsp = new FacetSearchParams(
                                new RangeFacetRequest<LongRange>("timestamp",
                                                                 new LongRange("Past hour", nowSec-3600, true, nowSec, true),
                                                                 new LongRange("Past six hours", nowSec-6*3600, true, nowSec, true),
                                                                 new LongRange("Past day", nowSec-24*3600, true, nowSec, true)));
    // Aggregatses the facet counts
    FacetsCollector fc = FacetsCollector.create(new RangeAccumulator(fsp, searcher.getIndexReader()));

    // MatchAllDocsQuery is for "browsing" (counts facets
    // for all non-deleted docs in the index); normally
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.LongRange

public class LongRangeMetaDataTransformer extends AbstractValidationParameterAwareTransformer
{
    protected Map<String, Object> transformMetaData(MetaDataEntry metaDataEntry)
    {
        Map<String, Object> results = new HashMap<String, Object>();
        LongRange annotation = metaDataEntry.getValue(LongRange.class);

        long minimum = annotation.minimum();

        if(minimum != Long.MIN_VALUE)
        {
            results.put(CommonMetaDataKeys.RANGE_MIN, minimum);
        }
        else
        {
            results.put(CommonMetaDataKeys.RANGE_MIN_DEFAULT, minimum);
        }

        long maximum = annotation.maximum();

        if(maximum != Long.MAX_VALUE)
        {
            results.put(CommonMetaDataKeys.RANGE_MAX, maximum);
        }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.LongRange

    protected void processValidation(FacesContext facesContext,
            UIComponent uiComponent, MetaDataEntry metaDataEntry,
            Object convertedObject) throws ValidatorException
    {

        LongRange annotation = metaDataEntry.getValue(LongRange.class);
        LongRangeValidator longRangeValidator = (LongRangeValidator)facesContext.getApplication()
                                                    .createValidator("javax.faces.LongRange");

        if(annotation.minimum() != Long.MIN_VALUE)
        {
            longRangeValidator.setMinimum(annotation.minimum());
        }

        if(annotation.maximum() != Long.MAX_VALUE)
        {
            longRangeValidator.setMaximum(annotation.maximum());
        }

        longRangeValidator.validate(facesContext, uiComponent, convertedObject);
    }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.LongRange

public class LongRangeMetaDataTransformer extends AbstractValidationParameterAwareTransformer
{
    protected Map<String, Object> transformMetaData(MetaDataEntry metaDataEntry)
    {
        Map<String, Object> results = new HashMap<String, Object>();
        LongRange annotation = metaDataEntry.getValue(LongRange.class);

        long minimum = annotation.minimum();

        if(minimum != Long.MIN_VALUE)
        {
            results.put(CommonMetaDataKeys.RANGE_MIN, minimum);
        }
        else
        {
            results.put(CommonMetaDataKeys.RANGE_MIN_DEFAULT, minimum);
        }

        long maximum = annotation.maximum();

        if(maximum != Long.MAX_VALUE)
        {
            results.put(CommonMetaDataKeys.RANGE_MAX, maximum);
        }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.LongRange

    protected void processValidation(FacesContext facesContext,
            UIComponent uiComponent, MetaDataEntry metaDataEntry,
            Object convertedObject) throws ValidatorException
    {

        LongRange annotation = metaDataEntry.getValue(LongRange.class);
        LongRangeValidator longRangeValidator = (LongRangeValidator)facesContext.getApplication()
                                                    .createValidator("javax.faces.LongRange");

        if(annotation.minimum() != Long.MIN_VALUE)
        {
            longRangeValidator.setMinimum(annotation.minimum());
        }

        if(annotation.maximum() != Long.MAX_VALUE)
        {
            longRangeValidator.setMaximum(annotation.maximum());
        }

        longRangeValidator.validate(facesContext, uiComponent, convertedObject);
    }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.LongRange

    protected void processValidation(FacesContext facesContext,
            UIComponent uiComponent, MetaDataEntry metaDataEntry,
            Object convertedObject) throws ValidatorException
    {

        LongRange annotation = metaDataEntry.getValue(LongRange.class);
        LongRangeValidator longRangeValidator = (LongRangeValidator)facesContext.getApplication()
                                                    .createValidator("javax.faces.LongRange");

        longRangeValidator.setMinimum(annotation.minimum());
        longRangeValidator.setMaximum(annotation.maximum());

        longRangeValidator.validate(facesContext, uiComponent, convertedObject);
    }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.baseval.annotation.LongRange

public class LongRangeMetaDataTransformer implements MetaDataTransformer
{
    public Map<String, Object> convertMetaData(MetaDataEntry metaDataEntry)
    {
        Map<String, Object> results = new HashMap<String, Object>();
        LongRange annotation = metaDataEntry.getValue(LongRange.class);

        long minimum = annotation.minimum();

        results.put(CommonMetaDataKeys.RANGE_MIN, minimum);
        results.put(CommonMetaDataKeys.RANGE_MAX, annotation.maximum());

        if(minimum > 0)
        {
            results.put(CommonMetaDataKeys.WEAK_REQUIRED, true);
        }
View Full Code Here

Examples of xbird.util.struct.LongRange

        }
        return dst;
    }

    public int[] transferBuffers(long startPageOffset, int aryLength, ILongCache<int[]> _pool) {
        LongRange range = _serContext.ranges().getRangeOf(startPageOffset);
        final int pageSize = _pageSize;
        long endPageOffset = (range == null) ? startPageOffset + pageSize : range.getEnd();
        final long lastPageOffset = restrictEndOffset(startPageOffset, endPageOffset, aryLength, pageSize);
        assert (lastPageOffset > startPageOffset) : "Illegal condition.. start:" + startPageOffset
                + " < end:" + lastPageOffset;
        final ByteChannel channel;
        try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.