Package org.apache.lucene.index
Class IndexReaderContext
- java.lang.Object
-
- org.apache.lucene.index.IndexReaderContext
-
- Direct Known Subclasses:
AtomicReaderContext
,CompositeReaderContext
public abstract class IndexReaderContext extends java.lang.Object
A struct like class that represents a hierarchical relationship betweenIndexReader
instances.
-
-
Field Summary
Fields Modifier and Type Field Description int
docBaseInParent
the doc base for this reader in the parent, 0 if parent is nullboolean
isTopLevel
true
if this context struct represents the top level reader within the hierarchical contextint
ordInParent
the ord for this reader in the parent, 0 if parent is nullCompositeReaderContext
parent
The reader context for this reader's immediate parent, or null if none
-
Method Summary
All Methods Instance Methods Abstract 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
.abstract java.util.List<AtomicReaderContext>
leaves()
Returns the context's leaves if this context is a top-level context.abstract IndexReader
reader()
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
true
if 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, 0 if parent is null
-
ordInParent
public final int ordInParent
the ord for this reader in the parent, 0 if parent is null
-
-
Method Detail
-
reader
public abstract IndexReader reader()
Returns theIndexReader
, this context represents.
-
leaves
public abstract java.util.List<AtomicReaderContext> leaves() throws java.lang.UnsupportedOperationException
Returns the context's leaves if this context is a top-level context. For convenience, if this is anAtomicReaderContext
this 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
.
-
-