You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by cu...@apache.org on 2004/05/11 21:28:51 UTC

cvs commit: jakarta-lucene/src/test/org/apache/lucene/index TestFilterIndexReader.java

cutting     2004/05/11 12:28:51

  Modified:    src/java/org/apache/lucene/index FilterIndexReader.java
               src/test/org/apache/lucene/index TestFilterIndexReader.java
  Log:
  Renamed protected field back to its 1.3 name, for back-compatibility.
  
  Revision  Changes    Path
  1.11      +27 -27    jakarta-lucene/src/java/org/apache/lucene/index/FilterIndexReader.java
  
  Index: FilterIndexReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/FilterIndexReader.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FilterIndexReader.java	11 May 2004 17:12:29 -0000	1.10
  +++ FilterIndexReader.java	11 May 2004 19:28:51 -0000	1.11
  @@ -73,68 +73,68 @@
       public void close() throws IOException { in.close(); }
     }
   
  -  protected IndexReader baseReader;
  +  protected IndexReader in;
   
     /**
      * <p>Construct a FilterIndexReader based on the specified base reader.
      * Directory locking for delete, undeleteAll, and setNorm operations is
      * left to the base reader.</p>
      * <p>Note that base reader is closed if this FilterIndexReader is closed.</p>
  -   * @param baseReader specified base reader.
  +   * @param in specified base reader.
      */
  -  public FilterIndexReader(IndexReader baseReader) {
  -    super(baseReader.directory());
  -    this.baseReader = baseReader;
  +  public FilterIndexReader(IndexReader in) {
  +    super(in.directory());
  +    this.in = in;
     }
   
     public TermFreqVector[] getTermFreqVectors(int docNumber)
             throws IOException {
  -    return baseReader.getTermFreqVectors(docNumber);
  +    return in.getTermFreqVectors(docNumber);
     }
   
     public TermFreqVector getTermFreqVector(int docNumber, String field)
             throws IOException {
  -    return baseReader.getTermFreqVector(docNumber, field);
  +    return in.getTermFreqVector(docNumber, field);
     }
   
  -  public int numDocs() { return baseReader.numDocs(); }
  -  public int maxDoc() { return baseReader.maxDoc(); }
  +  public int numDocs() { return in.numDocs(); }
  +  public int maxDoc() { return in.maxDoc(); }
   
  -  public Document document(int n) throws IOException { return baseReader.document(n); }
  +  public Document document(int n) throws IOException { return in.document(n); }
   
  -  public boolean isDeleted(int n) { return baseReader.isDeleted(n); }
  -  public boolean hasDeletions() { return baseReader.hasDeletions(); }
  -  protected void doUndeleteAll() throws IOException { baseReader.undeleteAll(); }
  +  public boolean isDeleted(int n) { return in.isDeleted(n); }
  +  public boolean hasDeletions() { return in.hasDeletions(); }
  +  protected void doUndeleteAll() throws IOException { in.undeleteAll(); }
   
  -  public byte[] norms(String f) throws IOException { return baseReader.norms(f); }
  +  public byte[] norms(String f) throws IOException { return in.norms(f); }
     public void norms(String f, byte[] bytes, int offset) throws IOException {
  -    baseReader.norms(f, bytes, offset);
  +    in.norms(f, bytes, offset);
     }
     protected void doSetNorm(int d, String f, byte b) throws IOException {
  -    baseReader.setNorm(d, f, b);
  +    in.setNorm(d, f, b);
     }
   
  -  public TermEnum terms() throws IOException { return baseReader.terms(); }
  -  public TermEnum terms(Term t) throws IOException { return baseReader.terms(t); }
  +  public TermEnum terms() throws IOException { return in.terms(); }
  +  public TermEnum terms(Term t) throws IOException { return in.terms(t); }
   
  -  public int docFreq(Term t) throws IOException { return baseReader.docFreq(t); }
  +  public int docFreq(Term t) throws IOException { return in.docFreq(t); }
   
  -  public TermDocs termDocs() throws IOException { return baseReader.termDocs(); }
  +  public TermDocs termDocs() throws IOException { return in.termDocs(); }
   
     public TermPositions termPositions() throws IOException {
  -    return baseReader.termPositions();
  +    return in.termPositions();
     }
   
  -  protected void doDelete(int n) throws IOException { baseReader.delete(n); }
  -  protected void doCommit() throws IOException { baseReader.commit(); }
  -  protected void doClose() throws IOException { baseReader.close(); }
  +  protected void doDelete(int n) throws IOException { in.delete(n); }
  +  protected void doCommit() throws IOException { in.commit(); }
  +  protected void doClose() throws IOException { in.close(); }
   
     public Collection getFieldNames() throws IOException {
  -    return baseReader.getFieldNames();
  +    return in.getFieldNames();
     }
   
     public Collection getFieldNames(boolean indexed) throws IOException {
  -    return baseReader.getFieldNames(indexed);
  +    return in.getFieldNames(indexed);
     }
   
     /**
  @@ -144,6 +144,6 @@
      * @return Collection of Strings indicating the names of the fields
      */
     public Collection getIndexedFieldNames(boolean storedTermVector) {
  -    return baseReader.getIndexedFieldNames(storedTermVector);
  +    return in.getIndexedFieldNames(storedTermVector);
     }
   }
  
  
  
  1.5       +2 -2      jakarta-lucene/src/test/org/apache/lucene/index/TestFilterIndexReader.java
  
  Index: TestFilterIndexReader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/test/org/apache/lucene/index/TestFilterIndexReader.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestFilterIndexReader.java	16 Apr 2004 09:17:05 -0000	1.4
  +++ TestFilterIndexReader.java	11 May 2004 19:28:51 -0000	1.5
  @@ -81,12 +81,12 @@
   
       /** Filter terms with TestTermEnum. */
       public TermEnum terms() throws IOException {
  -      return new TestTermEnum(baseReader.terms());
  +      return new TestTermEnum(in.terms());
       }
   
       /** Filter positions with TestTermPositions. */
       public TermPositions termPositions() throws IOException {
  -      return new TestTermPositions(baseReader.termPositions());
  +      return new TestTermPositions(in.termPositions());
       }
     }
   
  
  
  

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