Package org.apache.lucene.index
Class DocsWithFieldSet
java.lang.Object
org.apache.lucene.search.DocIdSet
org.apache.lucene.index.DocsWithFieldSet
- All Implemented Interfaces:
Accountable
Accumulator for documents that have a value for a field. This is optimized for the case that all
documents have a value.
-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(int docID) Add a document to the setint
Return the number of documents of this set.iterator()
Provides aDocIdSetIterator
to access the set.long
Return the memory usage of this object in bytes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Constructor Details
-
DocsWithFieldSet
public DocsWithFieldSet()Creates an empty DocsWithFieldSet.
-
-
Method Details
-
add
public void add(int docID) Add a document to the set- Parameters:
docID
- – document ID to be added
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal. -
iterator
Description copied from class:DocIdSet
Provides aDocIdSetIterator
to access the set. This implementation can returnnull
if there are no docs that match. -
cardinality
public int cardinality()Return the number of documents of this set.
-