Package org.apache.lucene.index
Class CompositeReaderContext
- java.lang.Object
-
- org.apache.lucene.index.IndexReaderContext
-
- org.apache.lucene.index.CompositeReaderContext
-
public final class CompositeReaderContext extends IndexReaderContext
IndexReaderContextforCompositeReaderinstance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classCompositeReaderContext.Builder
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<IndexReaderContext>childrenprivate java.util.List<LeafReaderContext>leavesprivate CompositeReaderreader-
Fields inherited from class org.apache.lucene.index.IndexReaderContext
docBaseInParent, identity, isTopLevel, ordInParent, parent
-
-
Constructor Summary
Constructors Modifier Constructor Description (package private)CompositeReaderContext(CompositeReaderContext parent, CompositeReader reader, int ordInParent, int docbaseInParent, java.util.List<IndexReaderContext> children)Creates aCompositeReaderContextfor intermediate readers that aren't not top-level readers in the current contextprivateCompositeReaderContext(CompositeReaderContext parent, CompositeReader reader, int ordInParent, int docbaseInParent, java.util.List<IndexReaderContext> children, java.util.List<LeafReaderContext> leaves)(package private)CompositeReaderContext(CompositeReader reader, java.util.List<IndexReaderContext> children, java.util.List<LeafReaderContext> leaves)Creates aCompositeReaderContextfor top-level readers with parent set tonull
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<IndexReaderContext>children()Returns the context's children iff this context is a composite context otherwisenull.(package private) static CompositeReaderContextcreate(CompositeReader reader)java.util.List<LeafReaderContext>leaves()Returns the context's leaves if this context is a top-level context.CompositeReaderreader()Returns theIndexReader, this context represents.-
Methods inherited from class org.apache.lucene.index.IndexReaderContext
id
-
-
-
-
Field Detail
-
children
private final java.util.List<IndexReaderContext> children
-
leaves
private final java.util.List<LeafReaderContext> leaves
-
reader
private final CompositeReader reader
-
-
Constructor Detail
-
CompositeReaderContext
CompositeReaderContext(CompositeReaderContext parent, CompositeReader reader, int ordInParent, int docbaseInParent, java.util.List<IndexReaderContext> children)
Creates aCompositeReaderContextfor intermediate readers that aren't not top-level readers in the current context
-
CompositeReaderContext
CompositeReaderContext(CompositeReader reader, java.util.List<IndexReaderContext> children, java.util.List<LeafReaderContext> leaves)
Creates aCompositeReaderContextfor top-level readers with parent set tonull
-
CompositeReaderContext
private CompositeReaderContext(CompositeReaderContext parent, CompositeReader reader, int ordInParent, int docbaseInParent, java.util.List<IndexReaderContext> children, java.util.List<LeafReaderContext> leaves)
-
-
Method Detail
-
create
static CompositeReaderContext create(CompositeReader reader)
-
leaves
public java.util.List<LeafReaderContext> leaves() throws java.lang.UnsupportedOperationException
Description copied from class:IndexReaderContextReturns 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
IndexReaderContext.children().- Specified by:
leavesin classIndexReaderContext- Throws:
java.lang.UnsupportedOperationException- if this is not a top-level context.- See Also:
IndexReaderContext.children()
-
children
public java.util.List<IndexReaderContext> children()
Description copied from class:IndexReaderContextReturns the context's children iff this context is a composite context otherwisenull.- Specified by:
childrenin classIndexReaderContext
-
reader
public CompositeReader reader()
Description copied from class:IndexReaderContextReturns theIndexReader, this context represents.- Specified by:
readerin classIndexReaderContext
-
-