Package org.apache.lucene.index
Class IndexReaderContext
- java.lang.Object
-
- org.apache.lucene.index.IndexReaderContext
-
- Direct Known Subclasses:
CompositeReaderContext,LeafReaderContext
public abstract class IndexReaderContext extends java.lang.ObjectA struct like class that represents a hierarchical relationship betweenIndexReaderinstances.
-
-
Field Summary
Fields Modifier and Type Field Description intdocBaseInParentthe doc base for this reader in the parent,0if parent is null(package private) java.lang.ObjectidentitybooleanisTopLeveltrueif this context struct represents the top level reader within the hierarchical contextintordInParentthe ord for this reader in the parent,0if parent is nullCompositeReaderContextparentThe reader context for this reader's immediate parent, or null if none
-
Constructor Summary
Constructors Constructor Description IndexReaderContext(CompositeReaderContext parent, int ordInParent, int docBaseInParent)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.util.List<IndexReaderContext>children()Returns the context's children iff this context is a composite context otherwisenull.java.lang.Objectid()Expert: Return anObjectthat uniquely identifies this context.abstract java.util.List<LeafReaderContext>leaves()Returns the context's leaves if this context is a top-level context.abstract IndexReaderreader()Returns theIndexReader, this context represents.
-
-
-
Field Detail
-
parent
public final CompositeReaderContext parent
The reader context for this reader's immediate parent, or null if none
-
isTopLevel
public final boolean isTopLevel
trueif this context struct represents the top level reader within the hierarchical context
-
docBaseInParent
public final int docBaseInParent
the doc base for this reader in the parent,0if parent is null
-
ordInParent
public final int ordInParent
the ord for this reader in the parent,0if parent is null
-
identity
final java.lang.Object identity
-
-
Constructor Detail
-
IndexReaderContext
IndexReaderContext(CompositeReaderContext parent, int ordInParent, int docBaseInParent)
-
-
Method Detail
-
id
public java.lang.Object id()
Expert: Return anObjectthat uniquely identifies this context. The returned object does neither reference thisIndexReaderContextnor the wrappedIndexReader.
-
reader
public abstract IndexReader reader()
Returns theIndexReader, this context represents.
-
leaves
public abstract java.util.List<LeafReaderContext> leaves() throws java.lang.UnsupportedOperationException
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:
java.lang.UnsupportedOperationException- if this is not a top-level context.- See Also:
children()
-
children
public abstract java.util.List<IndexReaderContext> children()
Returns the context's children iff this context is a composite context otherwisenull.
-
-