org.apache.lucene.mark
Class BasicMarkPos

Object
  extended by MarkPos
      extended by BasicMarkPos
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
BoundedMarkPos

public class BasicMarkPos
extends MarkPos

Stores a position within a single document field. Used by BasicWordIter to provide basic context marking over normal fields.

Created: Jan 15, 2005

Author:
Martin Haye

Field Summary
protected  int charPos
          Absolute position, in number of characters, from start of field
protected  String fullText
          The full text of the field
protected  int wordPos
          Absolute position, in number of words, from start of field
 
Constructor Summary
BasicMarkPos()
           
 
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 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
Absolute position, in number of words, from start of field


charPos

protected int charPos
Absolute position, in number of characters, from start of field


fullText

protected String fullText
The full text of the field

Constructor Detail

BasicMarkPos

public BasicMarkPos()
Method Detail

wordPos

public int wordPos()
Retrieves the absolute position, in number of words, from the start of the field.

Specified by:
wordPos in class MarkPos

countTextTo

public int countTextTo(MarkPos other)
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)
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