FileDocCategorySizeDatePackage
SegmentTermPositions.javaAPI DocApache Lucene 1.92243Mon Feb 20 09:20:14 GMT 2006org.apache.lucene.index

SegmentTermPositions

public final class SegmentTermPositions extends SegmentTermDocs implements TermPositions
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.

Fields Summary
private IndexInput
proxStream
private int
proxCount
private int
position
Constructors Summary
SegmentTermPositions(SegmentReader p)

    super(p);
    this.proxStream = (IndexInput)parent.proxStream.clone();
  
Methods Summary
public final voidclose()

    super.close();
    proxStream.close();
  
public final booleannext()

    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 intnextPosition()

    proxCount--;
    return position += proxStream.readVInt();
  
public final intread(int[] docs, int[] freqs)

    throw new UnsupportedOperationException("TermPositions does not support processing multiple documents in one call. Use TermDocs instead.");
  
final voidseek(org.apache.lucene.index.TermInfo ti)

    super.seek(ti);
    if (ti != null)
      proxStream.seek(ti.proxPointer);
    proxCount = 0;
  
protected voidskipProx(long proxPointer)
Called by super.skipTo().

    proxStream.seek(proxPointer);
    proxCount = 0;
  
protected final voidskippingDoc()

    for (int f = freq; f > 0; f--)		  // skip all positions
      proxStream.readVInt();