Save This Page
Home » lucene-3.0.1-src » org.apache.lucene.analysis.tokenattributes » [javadoc | source]
org.apache.lucene.analysis.tokenattributes
public interface: OffsetAttribute [javadoc | source]

All Implemented Interfaces:
    Attribute

All Known Implementing Classes:
    Token, OffsetAttributeImpl

The start and end character offset of a Token.
Method from org.apache.lucene.analysis.tokenattributes.OffsetAttribute Summary:
endOffset,   setOffset,   startOffset
Method from org.apache.lucene.analysis.tokenattributes.OffsetAttribute Detail:
 public int endOffset()
    Returns this Token's ending offset, one greater than the position of the last character corresponding to this token in the source text. The length of the token in the source text is (endOffset - startOffset).
 public  void setOffset(int startOffset,
    int endOffset)
    Set the starting and ending offset.
 public int startOffset()
    Returns this Token's starting offset, the position of the first character corresponding to this token in the source text. Note that the difference between endOffset() and startOffset() may not be equal to termText.length(), as the term text may have been altered by a stemmer or some other filter.