public interface OffsetAttribute extends Attribute
Modifier and Type | Method and Description |
---|---|
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.
|
void |
setOffset(int startOffset,
int endOffset)
Set the starting and ending offset.
|
int |
startOffset()
Returns this Token's starting offset, the position of the first character
corresponding to this token in the source text.
|
int startOffset()
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.
setOffset(int, int)
void setOffset(int startOffset, int endOffset)
IllegalArgumentException
- If startOffset
or endOffset
are negative, or if startOffset
is greater than
endOffset
startOffset()
,
endOffset()
int endOffset()
endOffset()
- startOffset()
).setOffset(int, int)
Copyright © 2000-2024 Apache Software Foundation. All Rights Reserved.