Top Description Fields Constructors Methods
com.ibm.icu.text

pack-priv Class ReplaceableContextIterator

extends Object
implements ContextIterator
Class Inheritance
All Implemented Interfaces
com.ibm.icu.impl.UCaseProps.ContextIterator
Imports
com.ibm.icu.impl.UCaseProps

Implementation of UCaseProps.ContextIterator, iterates over a Replaceable. See casetrn.cpp/utrans_rep_caseContextIterator(). See also UCharacter.StringContextIterator.

Field Summary

Modifier and TypeField and Description
protected int
protected int
protected int
protected int
protected int
protected int
protected int
protected boolean
protected Replaceable

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

Boolean value.
didReachLimit
()

Did forward context iteration with next() reach the iteration limit?

public int

Returns:

The start index of the current code point.
getCaseMapCPStart
()

Get the index of where the code point currently being case-mapped starts.

public int
next()

Implements com.ibm.icu.impl.UCaseProps.ContextIterator.next.

Iterate and return the next code point, moving in the direction determined by the reset() call.
public int

Returns:

The next code point to be case-mapped, or <0 when the iteration is done.
nextCaseMapCP
()

Iterate forward through the string to fetch the next code point to be case-mapped, and set the context indexes for it.

public int

Returns:

The delta for the change of the text length.
replace
(String
Replacement text.
text
)

Replace the current code point by its case mapping, and update the indexes.

public void
reset(int
>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.
direction
)

Implements com.ibm.icu.impl.UCaseProps.ContextIterator.reset.

Reset the iterator for forward or backward iteration.
public void
setContextLimits(int
Start of context for next().
contextStart
,
int
Limit of context for next().
contextLimit
)

Set the start and limit indexes for context iteration with next().

public void
setIndex(int
Iteration start index for nextCaseMapCP().
index
)

Set the index where nextCaseMapCP() is to start iterating.

public void
setLimit(int
The iteration limit.
lim
)

Set the iteration limit for nextCaseMapCP() to an index within the string.

public void
setText(Replaceable
Iteration text.
rep
)

Set the text for iteration.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextLimitback to summary
protected int contextLimit
contextStartback to summary
protected int contextStart
cpLimitback to summary
protected int cpLimit
cpStartback to summary
protected int cpStart
dirback to summary
protected int dir
indexback to summary
protected int index
limitback to summary
protected int limit
reachedLimitback to summary
protected boolean reachedLimit
repback to summary
protected Replaceable rep

Constructor Detail

ReplaceableContextIteratorback to summary
pack-priv ReplaceableContextIterator()

Constructor.

Method Detail

didReachLimitback to summary
public boolean didReachLimit()

Did forward context iteration with next() reach the iteration limit?

Returns:boolean

Boolean value.

getCaseMapCPStartback to summary
public int getCaseMapCPStart()

Get the index of where the code point currently being case-mapped starts.

Returns:int

The start index of the current code point.

nextback to summary
public int next()

Implements com.ibm.icu.impl.UCaseProps.ContextIterator.next.

Doc from com.ibm.icu.impl.UCaseProps.ContextIterator.next.

Iterate and return the next code point, moving in the direction determined by the reset() call.

Returns:int

Next code point, or <0 when the iteration is done.

nextCaseMapCPback to summary
public int nextCaseMapCP()

Iterate forward through the string to fetch the next code point to be case-mapped, and set the context indexes for it.

Returns:int

The next code point to be case-mapped, or <0 when the iteration is done.

replaceback to summary
public int replace(String text)

Replace the current code point by its case mapping, and update the indexes.

Parameters
text:String

Replacement text.

Returns:int

The delta for the change of the text length.

resetback to summary
public void reset(int direction)

Implements com.ibm.icu.impl.UCaseProps.ContextIterator.reset.

Doc from com.ibm.icu.impl.UCaseProps.ContextIterator.reset.

Reset the iterator for forward or backward iteration.

Parameters
direction:int

>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.

setContextLimitsback to summary
public void setContextLimits(int contextStart, int contextLimit)

Set the start and limit indexes for context iteration with next().

Parameters
contextStart:int

Start of context for next().

contextLimit:int

Limit of context for next().

setIndexback to summary
public void setIndex(int index)

Set the index where nextCaseMapCP() is to start iterating.

Parameters
index:int

Iteration start index for nextCaseMapCP().

setLimitback to summary
public void setLimit(int lim)

Set the iteration limit for nextCaseMapCP() to an index within the string. If the limit parameter is negative or past the string, then the string length is restored as the iteration limit.

Parameters
lim:int

The iteration limit.

setTextback to summary
public void setText(Replaceable rep)

Set the text for iteration.

Parameters
rep:Replaceable

Iteration text.