lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gol...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/index MultiReader.java
Date Mon, 17 May 2004 12:56:47 GMT
goller      2004/05/17 05:56:47

  Modified:    src/java/org/apache/lucene/index MultiReader.java
  Log:
  Changed explicit casts to SegmentTermEnum and
  SegmentTermDocs to TermEnum and TermDocs casts.
  This had obviously been forgotten when switching from
  SegmentsReader to MultiReader.
  
  Revision  Changes    Path
  1.7       +20 -20    jakarta-lucene/src/java/org/apache/lucene/index/MultiReader.java
  
  Index: MultiReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/MultiReader.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MultiReader.java	14 May 2004 12:49:46 -0000	1.6
  +++ MultiReader.java	17 May 2004 12:56:47 -0000	1.7
  @@ -267,12 +267,12 @@
       queue = new SegmentMergeQueue(readers.length);
       for (int i = 0; i < readers.length; i++) {
         IndexReader reader = readers[i];
  -      SegmentTermEnum termEnum;
  +      TermEnum termEnum;
   
         if (t != null) {
  -        termEnum = (SegmentTermEnum)reader.terms(t);
  +        termEnum = reader.terms(t);
         } else
  -        termEnum = (SegmentTermEnum)reader.terms();
  +        termEnum = reader.terms();
   
         SegmentMergeInfo smi = new SegmentMergeInfo(starts[i], termEnum, reader);
         if (t == null ? smi.next() : termEnum.term() != null)
  @@ -329,21 +329,21 @@
     protected int base = 0;
     protected int pointer = 0;
   
  -  private SegmentTermDocs[] segTermDocs;
  -  protected SegmentTermDocs current;              // == segTermDocs[pointer]
  +  private TermDocs[] readerTermDocs;
  +  protected TermDocs current;              // == readerTermDocs[pointer]
   
     public MultiTermDocs(IndexReader[] r, int[] s) {
       readers = r;
       starts = s;
   
  -    segTermDocs = new SegmentTermDocs[r.length];
  +    readerTermDocs = new TermDocs[r.length];
     }
   
     public int doc() {
  -    return base + current.doc;
  +    return base + current.doc();
     }
     public int freq() {
  -    return current.freq;
  +    return current.freq();
     }
   
     public void seek(Term term) {
  @@ -400,25 +400,25 @@
         return true;
     }
   
  -  private SegmentTermDocs termDocs(int i) throws IOException {
  +  private TermDocs termDocs(int i) throws IOException {
       if (term == null)
         return null;
  -    SegmentTermDocs result = segTermDocs[i];
  +    TermDocs result = readerTermDocs[i];
       if (result == null)
  -      result = segTermDocs[i] = termDocs(readers[i]);
  +      result = readerTermDocs[i] = termDocs(readers[i]);
       result.seek(term);
       return result;
     }
   
  -  protected SegmentTermDocs termDocs(IndexReader reader)
  +  protected TermDocs termDocs(IndexReader reader)
       throws IOException {
  -    return (SegmentTermDocs)reader.termDocs();
  +    return reader.termDocs();
     }
   
     public void close() throws IOException {
  -    for (int i = 0; i < segTermDocs.length; i++) {
  -      if (segTermDocs[i] != null)
  -        segTermDocs[i].close();
  +    for (int i = 0; i < readerTermDocs.length; i++) {
  +      if (readerTermDocs[i] != null)
  +        readerTermDocs[i].close();
       }
     }
   }
  @@ -428,12 +428,12 @@
       super(r,s);
     }
   
  -  protected SegmentTermDocs termDocs(IndexReader reader) throws IOException {
  -    return (SegmentTermDocs)reader.termPositions();
  +  protected TermDocs termDocs(IndexReader reader) throws IOException {
  +    return (TermDocs)reader.termPositions();
     }
   
     public int nextPosition() throws IOException {
  -    return ((SegmentTermPositions)current).nextPosition();
  +    return ((TermPositions)current).nextPosition();
     }
   
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message