Package com.browseengine.bobo.util

Examples of com.browseengine.bobo.util.BigNestedIntArray


  protected int _maxItems = BigNestedIntArray.MAX_ITEMS;
  protected boolean _overflow = false;

  public MultiValueFacetDataCache() {
    super();
    _nestedArray = new BigNestedIntArray();
  }
View Full Code Here


  @Override
  public RandomAccessDocIdSet getRandomAccessDocIdSet(BoboSegmentReader reader) throws IOException {
    final MultiValueFacetDataCache<?> dataCache = multiDataCacheBuilder.build(reader);
    final int index = dataCache.valArray.indexOf(_val);
    final BigNestedIntArray nestedArray = dataCache._nestedArray;
    if (index < 0) {
      return EmptyDocIdSet.getInstance();
    } else {
      return new RandomAccessDocIdSet() {
        @Override
        public DocIdSetIterator iterator() {
          return new MultiValueFacetDocIdSetIterator(dataCache, index);
        }

        @Override
        final public boolean get(int docId) {
          return nestedArray.contains(docId, index);
        }

      };
    }
  }
View Full Code Here

    return new FacetCountCollectorSource() {

      @Override
      public FacetCountCollector getFacetCountCollector(BoboSegmentReader reader, int docBase) {
        MultiValueFacetDataCache dataCache = getFacetData(reader);
        final BigNestedIntArray _nestedArray = dataCache._nestedArray;
        return new RangeFacetCountCollector(_name, dataCache, docBase, ospec, _predefinedRanges) {
          @Override
          public void collect(int docid) {
            _nestedArray.countNoReturn(docid, _count);
          }
        };
      }
    };
  }
View Full Code Here

  public final BigNestedIntArray _weightArray;

  public MultiValueWithWeightFacetDataCache() {
    super();
    _weightArray = new BigNestedIntArray();
  }
View Full Code Here

  public RandomAccessDocIdSet getRandomAccessDocIdSet(final BoboSegmentReader reader)
      throws IOException {
    final FacetDataCache<?> dataCache = _facetHandler.getFacetData(reader);

    final boolean multi = dataCache instanceof MultiValueFacetDataCache;
    final BigNestedIntArray nestedArray = multi ? ((MultiValueFacetDataCache<?>) dataCache)._nestedArray
        : null;
    final int[] range = parse(dataCache, _rangeString);

    if (range == null) return null;

    if (range[0] > range[1]) {
      return EmptyDocIdSet.getInstance();
    }

    if (range[0] == range[1] && range[0] < 0) {
      return EmptyDocIdSet.getInstance();
    }

    return new RandomAccessDocIdSet() {
      int _start = range[0];
      int _end = range[1];

      @Override
      final public boolean get(int docId) {
        if (multi) {
          nestedArray.containsValueInRange(docId, _start, _end);
        }
        int index = dataCache.orderArray.get(docId);
        return index >= _start && index <= _end;
      }
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.util.BigNestedIntArray

Copyright © 2018 www.massapicom. 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.