For IntelliJ IDEA,
Android Studio or Eclipse



private void myMethod () {OpenBitSet o =
IndexReader indexReader;new OpenBitSet(indexReader.maxDoc())
new OpenBitSet(long1)
- Smart code suggestions by Codota
}
@Override public boolean next() throws IOException { doc = openBitSet.nextSetBit(doc+1); return (doc != -1) && (doc < (solrIndexReader.getBase() + solrIndexReader.maxDoc())); }
private Set<String> getIssueIdsDirectly() throws IOException { final Set<String> issueIds = new TreeSet<String>(); FieldSelector selector = new FieldSelector() { @Override public FieldSelectorResult accept(final String fieldName) { return fieldName.equals(DocumentConstants.ISSUE_ID) ? FieldSelectorResult.LOAD_AND_BREAK : FieldSelectorResult.NO_LOAD; } }; // Do a virtual trim of the bit set so we don't unnecessarily scan to the end docIds.setNumWords(OpenBitSet.bits2words(maxDocId + 1)); for (int docId = docIds.nextSetBit(minDocId); docId >= 0; docId = docIds.nextSetBit(docId+1)) { Document doc = indexReader.document(docId, selector); issueIds.add(doc.get(DocumentConstants.ISSUE_ID)); } return issueIds; }
@Override public double getFacetSelectivity(BoboSegmentReader reader) { FacetDataCache<?> dataCache = facetDataCacheBuilder.build(reader); final OpenBitSet openBitSet = getBitSet(dataCache); int[] frequencies = dataCache.freqs; double selectivity = 0; int accumFreq = 0; int index = openBitSet.nextSetBit(0); while (index >= 0) { accumFreq += frequencies[index]; index = openBitSet.nextSetBit(index + 1); } int total = reader.maxDoc(); selectivity = (double) accumFreq / (double) total; if (selectivity > 0.999) { selectivity = 1.0; } return selectivity; } }
private boolean shouldElementBeIgnored(long dbId, SolrIndexSearcher solrIndexSearcher, DocSet skippingDocs) throws IOException { boolean result = false; if ((skipDescendantAuxDocsForSpecificTypes && !typesForSkippingDescendantAuxDocs.isEmpty()) || (skipDescendantAuxDocsForSpecificAspects && !aspectsForSkippingDescendantAuxDocs.isEmpty())) { BooleanQuery query = new BooleanQuery(); query.add(new TermQuery(new Term(QueryConstants.FIELD_DBID, NumericEncoder.encode(dbId))), Occur.MUST); DocSet docSet = solrIndexSearcher.getDocSet(query); int index = -1; if (docSet instanceof BitDocSet) { BitDocSet source = (BitDocSet) docSet; OpenBitSet openBitSet = source.getBits(); index = openBitSet.nextSetBit(index + 1); } else { DocIterator it = docSet.iterator(); if (it.hasNext()) { index = it.nextDoc(); } } result = (-1 != index) && skippingDocs.exists(index); } return result; }
public boolean next() throws IOException { position++; position = set.nextSetBit(position); return (position != -1); }
OpenBitSet openBitSet = source.getBits(); int current = -1; while ((current = openBitSet.nextSetBit(current + 1)) != -1)
OpenBitSet openBitSet = source.getBits(); int current = -1; while ((current = openBitSet.nextSetBit(current + 1)) != -1)
OpenBitSet openBitSet = source.getBits(); int current = -1; while ((current = openBitSet.nextSetBit(current + 1)) != -1)
OpenBitSet openBitSet = source.getBits(); int current = -1; while((current = openBitSet.nextSetBit(current+1)) != -1)
while( (s = set.nextSetBit(s+1)) != -1)
OpenBitSet openBitSet = source.getBits(); int current = -1; while ((current = openBitSet.nextSetBit(current + 1)) != -1)
/** * Returns a list of all set column indices. * * @return the list of indices with set bits */ public List<Integer> getSetBits() { List<Integer> setBits = new ArrayList<>(size()); int setBitIndex = 0; while (true) { setBitIndex = bitset.nextSetBit(setBitIndex); if (setBitIndex == -1) { break; } else { setBits.add(setBitIndex); } setBitIndex++; } return setBits; }
while (((current = allLeafDocs.nextSetBit(current + 1)) < start + length) && (current >= 0))
while ((doc = allLeafDocs.nextSetBit(doc + 1)) != -1)