public Filter getTopFilter() { final OpenBitSet bs = getBits();
public DocSet union(DocSet other) { OpenBitSet newbits = (OpenBitSet)(this.getBits().clone()); newbits.or(other.getBits()); return new BitDocSet(newbits); }
public DocSet andNot(DocSet other) { OpenBitSet newbits = (OpenBitSet)(this.getBits().clone()); newbits.andNot(other.getBits()); return new BitDocSet(newbits); }
public DocSet intersection(DocSet other) { // intersection is overloaded in the smaller DocSets to be more // efficient, so dispatch off of it instead. if (!(other instanceof BitDocSet)) { return other.intersection(this); } // Default... handle with bitsets. OpenBitSet newbits = (OpenBitSet)(this.getBits().clone()); newbits.and(other.getBits()); return new BitDocSet(newbits); }
public boolean equals(Object obj) { if (!(obj instanceof DocSet)) return false; DocSet other = (DocSet)obj; if (this.size() != other.size()) return false; if (this instanceof DocList && other instanceof DocList) { // compare ordering DocIterator i1=this.iterator(); DocIterator i2=other.iterator(); while(i1.hasNext() && i2.hasNext()) { if (i1.nextDoc() != i2.nextDoc()) return false; } return true; // don't compare matches } // if (this.size() != other.size()) return false; return this.getBits().equals(other.getBits()); }