org.apache.lucene.chunk
Class ChunkMarkPos

Object
  extended by MarkPos
      extended by ChunkMarkPos
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
XtfChunkMarkPos

public class ChunkMarkPos
extends MarkPos

Tracks the position of a ChunkedWordIter as it progresses through a document which has been broken into chunks.


Field Summary
protected  int charPos
          Character position within the current chunk
protected  Chunk chunk
          Current chunk
protected  int wordPos
          Word position within the entire document
 
Constructor Summary
ChunkMarkPos()
           
 
Method Summary
 int countTextTo(MarkPos other)
          Counts the number of characters of text starting at this position and ending at another position.
 String getTextTo(MarkPos other)
          Retrieves all the text starting at this position and ending at another position.
 int wordPos()
          Retrieves the absolute position (in number of words) from the start of the document or field.
 
Methods inherited from class MarkPos
clone
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wordPos

protected int wordPos
Word position within the entire document


charPos

protected int charPos
Character position within the current chunk


chunk

protected Chunk chunk
Current chunk

Constructor Detail

ChunkMarkPos

public ChunkMarkPos()
Method Detail

wordPos

public int wordPos()
Description copied from class: MarkPos
Retrieves the absolute position (in number of words) from the start of the document or field. Not the same as the count of tokens, since not all tokens have getPositionIncrement() equal to 1.

Specified by:
wordPos in class MarkPos

countTextTo

public int countTextTo(MarkPos other)
Description copied from class: MarkPos
Counts the number of characters of text starting at this position and ending at another position. It is an error if they are out of order.

Specified by:
countTextTo in class MarkPos

getTextTo

public String getTextTo(MarkPos other)
Description copied from class: MarkPos
Retrieves all the text starting at this position and ending at another position. It is an error if they are out of order.

Specified by:
getTextTo in class MarkPos