FilterIndexReader.cs :  » Search-Engines » dotLucene » Lucene » Net » Index » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Search Engines » dotLucene 
dotLucene » Lucene » Net » Index » FilterIndexReader.cs
/*
 * Copyright 2004 The Apache Software Foundation
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;
using DocumentLucene.Net.Documents.Document;
using FieldLucene.Net.Documents.Field;

namespace Lucene.Net.Index{
  
  /// <summary>A <code>FilterIndexReader</code> contains another IndexReader, which it
  /// uses as its basic source of data, possibly transforming the data along the
  /// way or providing additional functionality. The class
  /// <code>FilterIndexReader</code> itself simply implements all abstract methods
  /// of <code>IndexReader</code> with versions that pass all requests to the
  /// contained index reader. Subclasses of <code>FilterIndexReader</code> may
  /// further override some of these methods and may also provide additional
  /// methods and fields.
  /// </summary>
  public class FilterIndexReader : IndexReader
  {
    
    /// <summary>Base class for filtering {@link TermDocs} implementations. </summary>
    public class FilterTermDocs : TermDocs
    {
      protected internal TermDocs in_Renamed;
      
      public FilterTermDocs(TermDocs in_Renamed)
      {
        this.in_Renamed = in_Renamed;
      }
      
      public virtual void  Seek(Term term)
      {
        in_Renamed.Seek(term);
      }
      public virtual void  Seek(TermEnum termEnum)
      {
        in_Renamed.Seek(termEnum);
      }
      public virtual int Doc()
      {
        return in_Renamed.Doc();
      }
      public virtual int Freq()
      {
        return in_Renamed.Freq();
      }
      public virtual bool Next()
      {
        return in_Renamed.Next();
      }
      public virtual int Read(int[] docs, int[] freqs)
      {
        return in_Renamed.Read(docs, freqs);
      }
      public virtual bool SkipTo(int i)
      {
        return in_Renamed.SkipTo(i);
      }
      public virtual void  Close()
      {
        in_Renamed.Close();
      }
    }
    
    /// <summary>Base class for filtering {@link TermPositions} implementations. </summary>
    public class FilterTermPositions : FilterTermDocs, TermPositions
    {
      
      public FilterTermPositions(TermPositions in_Renamed) : base(in_Renamed)
      {
      }
      
      public virtual int NextPosition()
      {
        return ((TermPositions) this.in_Renamed).NextPosition();
      }
    }
    
    /// <summary>Base class for filtering {@link TermEnum} implementations. </summary>
    public class FilterTermEnum : TermEnum
    {
      protected internal TermEnum in_Renamed;
      
      public FilterTermEnum(TermEnum in_Renamed)
      {
        this.in_Renamed = in_Renamed;
      }
      
      public override bool Next()
      {
        return in_Renamed.Next();
      }
      public override Term Term()
      {
        return in_Renamed.Term();
      }
      public override int DocFreq()
      {
        return in_Renamed.DocFreq();
      }
      public override void  Close()
      {
        in_Renamed.Close();
      }
    }
    
    protected internal IndexReader in_Renamed;
    
    /// <summary> <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>
    /// </summary>
    /// <param name="in">specified base reader.
    /// </param>
    public FilterIndexReader(IndexReader in_Renamed):base(in_Renamed.Directory())
    {
      this.in_Renamed = in_Renamed;
    }
    
    public override TermFreqVector[] GetTermFreqVectors(int docNumber)
    {
      return in_Renamed.GetTermFreqVectors(docNumber);
    }
    
    public override TermFreqVector GetTermFreqVector(int docNumber, System.String field)
    {
      return in_Renamed.GetTermFreqVector(docNumber, field);
    }
    
    public override int NumDocs()
    {
      return in_Renamed.NumDocs();
    }
    public override int MaxDoc()
    {
      return in_Renamed.MaxDoc();
    }
    
    public override Document Document(int n)
    {
      return in_Renamed.Document(n);
    }
    
    public override bool IsDeleted(int n)
    {
      return in_Renamed.IsDeleted(n);
    }
    public override bool HasDeletions()
    {
      return in_Renamed.HasDeletions();
    }
    protected internal override void  DoUndeleteAll()
    {
      in_Renamed.UndeleteAll();
    }
    
    public override bool HasNorms(System.String field)
    {
      return in_Renamed.HasNorms(field);
    }
    
    public override byte[] Norms(System.String f)
    {
      return in_Renamed.Norms(f);
    }
    public override void  Norms(System.String f, byte[] bytes, int offset)
    {
      in_Renamed.Norms(f, bytes, offset);
    }
    protected internal override void  DoSetNorm(int d, System.String f, byte b)
    {
      in_Renamed.SetNorm(d, f, b);
    }
    
    public override TermEnum Terms()
    {
      return in_Renamed.Terms();
    }
    public override TermEnum Terms(Term t)
    {
      return in_Renamed.Terms(t);
    }
    
    public override int DocFreq(Term t)
    {
      return in_Renamed.DocFreq(t);
    }
    
    public override TermDocs TermDocs()
    {
      return in_Renamed.TermDocs();
    }
    
    public override TermPositions TermPositions()
    {
      return in_Renamed.TermPositions();
    }
    
    protected internal override void  DoDelete(int n)
    {
      in_Renamed.Delete(n);
    }
    protected internal override void  DoCommit()
    {
      in_Renamed.Commit();
    }
    protected internal override void  DoClose()
    {
      in_Renamed.Close();
    }
    
    public override System.Collections.ICollection GetFieldNames()
    {
      return in_Renamed.GetFieldNames();
    }
    
    public override System.Collections.ICollection GetFieldNames(bool indexed)
    {
      return in_Renamed.GetFieldNames(indexed);
    }
    
    public override System.Collections.ICollection GetIndexedFieldNames(Field.TermVector tvSpec)
    {
      return in_Renamed.GetIndexedFieldNames(tvSpec);
    }
    
    public override System.Collections.ICollection GetFieldNames(IndexReader.FieldOption fieldNames)
    {
      return in_Renamed.GetFieldNames(fieldNames);
    }
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.