public interface WordIter
extends Cloneable
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
Modifier and Type | Field and Description |
---|---|
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) |
Modifier and Type | Method and Description |
---|---|
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
|
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)
Object clone()
boolean next(boolean force)
force
- true to ignore section boundariesboolean prev(boolean force)
force
- true to ignore section boundariesvoid 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.