org.apache.lucene.util
Class ReaderUtil

java.lang.Object
  extended by org.apache.lucene.util.ReaderUtil

public class ReaderUtil
extends Object

Common util methods for dealing with IndexReaders.


Constructor Summary
ReaderUtil()
           
 
Method Summary
static void gatherSubReaders(List allSubReaders, IndexReader reader)
          Gathers sub-readers from reader into a List.
static int subIndex(int n, int[] docStarts)
          Returns index of the searcher/reader for document n in the array used to construct this searcher/reader.
static IndexReader subReader(IndexReader reader, int subIndex)
          Returns sub-reader subIndex from reader.
static IndexReader subReader(int doc, IndexReader reader)
          Returns sub IndexReader that contains the given document id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReaderUtil

public ReaderUtil()
Method Detail

gatherSubReaders

public static void gatherSubReaders(List allSubReaders,
                                    IndexReader reader)
Gathers sub-readers from reader into a List.

Parameters:
allSubReaders -
reader -

subReader

public static IndexReader subReader(int doc,
                                    IndexReader reader)
Returns sub IndexReader that contains the given document id.

Parameters:
doc - id of document
reader - parent reader
Returns:
sub reader of parent which contains the specified doc id

subReader

public static IndexReader subReader(IndexReader reader,
                                    int subIndex)
Returns sub-reader subIndex from reader.

Parameters:
reader - parent reader
subIndex - index of desired sub reader
Returns:
the subreader at subIndex

subIndex

public static int subIndex(int n,
                           int[] docStarts)
Returns index of the searcher/reader for document n in the array used to construct this searcher/reader.



Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.