/** * Convenience wrapper method: If {@code acceptDocs == null} it returns the original set without wrapping. * @param set Underlying DocIdSet. If {@code null}, this method returns {@code null} * @param acceptDocs Allowed docs, all docids not in this set will not be returned by this DocIdSet. * If {@code null}, this method returns the original set without wrapping. */ public static DocIdSet wrap(DocIdSet set, Bits acceptDocs) { return (set == null || acceptDocs == null) ? set : new BitsFilteredDocIdSet(set, acceptDocs); }
/** * Convenience wrapper method: If {@code acceptDocs == null} it returns the original set without wrapping. * @param set Underlying DocIdSet. If {@code null}, this method returns {@code null} * @param acceptDocs Allowed docs, all docids not in this set will not be returned by this DocIdSet. * If {@code null}, this method returns the original set without wrapping. */ public static DocIdSet wrap(DocIdSet set, Bits acceptDocs) { return (set == null || acceptDocs == null) ? set : new BitsFilteredDocIdSet(set, acceptDocs); }