RandomAccessFilter.java :  » Search » bobo-browse » com » browseengine » bobo » facets » filter » Java Open Source

Java Open Source » Search » bobo browse 
bobo browse » com » browseengine » bobo » facets » filter » RandomAccessFilter.java
package com.browseengine.bobo.facets.filter;

import java.io.IOException;

import org.apache.lucene.index.IndexReader;
import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.Filter;

import com.browseengine.bobo.api.BoboIndexReader;
import com.browseengine.bobo.docidset.RandomAccessDocIdSet;

public abstract class RandomAccessFilter extends Filter
{
  private static final long serialVersionUID = 1L;

  @Override 
  public DocIdSet getDocIdSet(IndexReader reader) throws IOException
  {
  if (reader instanceof BoboIndexReader){
      return getRandomAccessDocIdSet((BoboIndexReader)reader);
  }
  else{
    throw new IllegalStateException("reader not instance of "+BoboIndexReader.class);
  }
  }
  
  public abstract RandomAccessDocIdSet getRandomAccessDocIdSet(BoboIndexReader reader) throws IOException;
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.