|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WordIter
Interface for iterating over the contents of a field or document on a
word-oriented basis. Instances of this class are used for context and
hit marking operations by ContextMarker
. Optionally, derived
classes can support semi-rigid section boundaries within the text; the
context for a given hit will never cross one of these boundaries.
Created: Dec 17, 2004
Field Summary | |
---|---|
static int |
FIELD_END
See getPos(int) or getPos(MarkPos,int) |
static int |
FIELD_START
See getPos(int) or getPos(MarkPos,int) |
static int |
TERM_END
See getPos(int) or getPos(MarkPos,int) |
static int |
TERM_END_PLUS
See getPos(int) or getPos(MarkPos,int) |
static int |
TERM_START
See getPos(int) or getPos(MarkPos,int) |
Method Summary | |
---|---|
Object |
clone()
Make an exact, independent, copy of this iterator |
MarkPos |
getPos(int startOrEnd)
Retrieve the start or end of the current position. |
void |
getPos(MarkPos pos,
int startOrEnd)
Replace the position within a MarkPos created by getPos(int)
using the iterator's current position. |
boolean |
next(boolean force)
Advance to the next word. |
boolean |
prev(boolean force)
Back up to the previous word. |
void |
seekFirst(int wordPos,
boolean force)
Reposition the iterator at the first word whose position is greater than or equal to 'wordPos'. |
void |
seekLast(int wordPos,
boolean force)
Reposition the iterator at the last word whose position is less than or equal to 'wordPos'. |
String |
term()
Retrieve the text of the term at the current position |
Field Detail |
---|
static final int FIELD_START
getPos(int)
or getPos(MarkPos,int)
static final int TERM_START
getPos(int)
or getPos(MarkPos,int)
static final int TERM_END
getPos(int)
or getPos(MarkPos,int)
static final int TERM_END_PLUS
getPos(int)
or getPos(MarkPos,int)
static final int FIELD_END
getPos(int)
or getPos(MarkPos,int)
Method Detail |
---|
Object clone()
boolean next(boolean force)
force
- true to ignore section boundaries
boolean prev(boolean force)
force
- true to ignore section boundaries
void seekFirst(int wordPos, boolean force)
wordPos
- Position to seek toforce
- true to ignore section boundariesvoid seekLast(int wordPos, boolean force)
wordPos
- Position to seek toforce
- true to ignore section boundariesString term()
MarkPos getPos(int startOrEnd)
startOrEnd
- FIELD_START for the very start of the field;
TERM_START for the first character of the word;
TERM_END for the last character of the word;
TERM_END_PLUS for the last character plus any trailing
punctuation and/or spaces;
FIELD_END for the very last end of the field.void getPos(MarkPos pos, int startOrEnd)
getPos(int)
using the iterator's current position.
startOrEnd
- FIELD_START for the very start of the field;
TERM_START for the first character of the word;
TERM_END for the last character of the word;
TERM_END_PLUS for the last character plus any trailing
punctuation and/or spaces;
FIELD_END for the very last end of the field.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |