public static final class CaseMapImpl.StringContextIterator extends Object implements UCaseProps.ContextIterator
| Modifier and Type | Field and Description |
|---|---|
protected int |
cpLimit |
protected int |
cpStart |
protected int |
dir |
protected int |
index |
protected int |
limit |
protected CharSequence |
s |
| Constructor and Description |
|---|
StringContextIterator(CharSequence src)
Constructor.
|
StringContextIterator(CharSequence src,
int cpStart,
int cpLimit)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCPLength() |
int |
getCPLimit()
Returns the limit of the code point that was last returned
by nextCaseMapCP().
|
int |
getCPStart()
Returns the start of the code point that was last returned
by nextCaseMapCP().
|
void |
moveTo(int i) |
void |
moveToLimit()
Move to the iteration limit without fetching code points up to there.
|
int |
next()
Iterate and return the next code point, moving in the direction
determined by the reset() call.
|
int |
nextCaseMapCP()
Iterate forward through the string to fetch the next code point
to be case-mapped, and set the context indexes for it.
|
void |
reset(int direction)
Reset the iterator for forward or backward iteration.
|
void |
setCPStartAndLimit(int s,
int l) |
void |
setLimit(int lim)
Set the iteration limit for nextCaseMapCP() to an index within the string.
|
protected CharSequence s
protected int index
protected int limit
protected int cpStart
protected int cpLimit
protected int dir
public StringContextIterator(CharSequence src)
src - String to iterate over.public StringContextIterator(CharSequence src, int cpStart, int cpLimit)
src - String to iterate over.cpStart - Start index of the current code point.cpLimit - Limit index of the current code point.public void setLimit(int lim)
This limit does not affect the next() function which always iterates to the very end of the string.
lim - The iteration limit.public void moveToLimit()
public void moveTo(int i)
public int nextCaseMapCP()
When the iteration limit is reached (and -1 is returned), getCPStart() will be at the iteration limit.
Iteration with next() does not affect the position for nextCaseMapCP().
public void setCPStartAndLimit(int s,
int l)
public int getCPStart()
public int getCPLimit()
public int getCPLength()
public void reset(int direction)
UCaseProps.ContextIteratorreset in interface UCaseProps.ContextIteratordirection - >0: Begin iterating forward from the first code point
after the one that is being case-mapped.
<0: Begin iterating backward from the first code point
before the one that is being case-mapped.public int next()
UCaseProps.ContextIteratornext in interface UCaseProps.ContextIterator