/*
 * Copyright 2012 Greplin, Inc. All Rights Reserved.
 */

package com.greplin.lucene.filter;

import org.apache.lucene.util.FixedBitSet;

/**
 * A mutable sub-slice of a DocIdSet.
 */
public class FixedBitSetSlice extends DocIdSetSlice {

  /**
   * The underlying fixed bit set.
   */
  private final FixedBitSet underlying;


  /**
   * Constructs a DocIdSet that is a slice of a FixedBitSet.
   * @param underlying the underlying FixedBitSet
   * @param start the start of the slice
   * @param end the end of the slice
   */
  public FixedBitSetSlice(
      final FixedBitSet underlying, final int start, final int end) {
    super(underlying, start, end);
    this.underlying = underlying;
  }


  /**
   * @return the underlying FixedBitSet
   */
  public FixedBitSet getUnderlying() {
    return underlying;
  }


  /**
   * Sets the index-th bit of this slice, meaning the
   * (start + index)th bit of the underlying bitset.
   * @param index the index into the slice to set
   */
  public void set(final int index) {
    this.underlying.set(index + this.getStart());
  }


  /**
   * Clears the index-th bit of this slice, meaning the
   * (start + index)th bit of the underlying bitset.
   * @param index the index into the slice to clear
   */
  public void clear(final int index) {
    this.underlying.clear(index + this.getStart());
  }

}

@@ -809,32 +809,340 @@
 derlying;%0A  %7D%0A%0A%0A
+  /**%0A   * Gets the index-th bit of this slice, meaning the%0A   * (start + index)th bit of the underlying bitset.%0A   * @param index the index into the slice to get%0A   * @return whether the bit is set%0A   */%0A  public boolean get(final int index) %7B%0A    return this.underlying.get(index + this.getStart());%0A  %7D%0A%0A%0A
   /**%0A   * Sets 

Add a get bit function to FixedBitSetSlice