Package org.apache.lucene.index
Class IndexReaderContext
java.lang.Object
org.apache.lucene.index.IndexReaderContext
- Direct Known Subclasses:
CompositeReaderContext,LeafReaderContext
A struct like class that represents a hierarchical relationship between
IndexReader instances.-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intthe doc base for this reader in the parent, 0 if parent is null(package private) final Objectfinal booleantrueif this context struct represents the top level reader within the hierarchical contextfinal intthe ord for this reader in the parent, 0 if parent is nullfinal CompositeReaderContextThe reader context for this reader's immediate parent, or null if none -
Constructor Summary
ConstructorsConstructorDescriptionIndexReaderContext(CompositeReaderContext parent, int ordInParent, int docBaseInParent) -
Method Summary
Modifier and TypeMethodDescriptionabstract List<IndexReaderContext> children()Returns the context's children iff this context is a composite context otherwisenull.id()Expert: Return anObjectthat uniquely identifies this context.abstract List<LeafReaderContext> leaves()Returns the context's leaves if this context is a top-level context.abstract IndexReaderreader()Returns theIndexReader, this context represents.
-
Field Details
-
parent
The reader context for this reader's immediate parent, or null if none -
isTopLevel
public final boolean isTopLeveltrueif this context struct represents the top level reader within the hierarchical context -
docBaseInParent
public final int docBaseInParentthe doc base for this reader in the parent, 0 if parent is null -
ordInParent
public final int ordInParentthe ord for this reader in the parent, 0 if parent is null -
identity
-
-
Constructor Details
-
IndexReaderContext
IndexReaderContext(CompositeReaderContext parent, int ordInParent, int docBaseInParent)
-
-
Method Details
-
id
Expert: Return anObjectthat uniquely identifies this context. The returned object does neither reference thisIndexReaderContextnor the wrappedIndexReader. -
reader
Returns theIndexReader, this context represents. -
leaves
Returns the context's leaves if this context is a top-level context. For convenience, if this is anLeafReaderContextthis returns itself as the only leaf.Note: this is convenience method since leaves can always be obtained by walking the context tree using
children().- Throws:
UnsupportedOperationException- if this is not a top-level context.- See Also:
-
children
Returns the context's children iff this context is a composite context otherwisenull.
-