⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 segmenttermpositions.java

📁 lucene完整源码
💻 JAVA
字号:
package org.apache.lucene.index;/** * 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. */import java.io.IOException;import org.apache.lucene.store.IndexInput;final class SegmentTermPositionsextends SegmentTermDocs implements TermPositions {  private IndexInput proxStream;  private int proxCount;  private int position;    SegmentTermPositions(SegmentReader p) {    super(p);    this.proxStream = (IndexInput)parent.proxStream.clone();  }  final void seek(TermInfo ti) throws IOException {    super.seek(ti);    if (ti != null)      proxStream.seek(ti.proxPointer);    proxCount = 0;  }  public final void close() throws IOException {    super.close();    proxStream.close();  }  public final int nextPosition() throws IOException {    proxCount--;    return position += proxStream.readVInt();  }  protected final void skippingDoc() throws IOException {    for (int f = freq; f > 0; f--)		  // skip all positions      proxStream.readVInt();  }  public final boolean next() throws IOException {    for (int f = proxCount; f > 0; f--)		  // skip unread positions      proxStream.readVInt();    if (super.next()) {				  // run super      proxCount = freq;				  // note frequency      position = 0;				  // reset position      return true;    }    return false;  }  public final int read(final int[] docs, final int[] freqs) {    throw new UnsupportedOperationException("TermPositions does not support processing multiple documents in one call. Use TermDocs instead.");  }  /** Called by super.skipTo(). */  protected void skipProx(long proxPointer) throws IOException {    proxStream.seek(proxPointer);    proxCount = 0;  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -