Package com.ibm.icu.impl.coll
Class FCDUTF16CollationIterator
java.lang.Object
com.ibm.icu.impl.coll.CollationIterator
com.ibm.icu.impl.coll.UTF16CollationIterator
com.ibm.icu.impl.coll.FCDUTF16CollationIterator
Incrementally checks the input text for FCD and normalizes where necessary.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private final Normalizer2Impl
private StringBuilder
private int
private CharSequence
private static final int
private int
private int
Fields inherited from class com.ibm.icu.impl.coll.UTF16CollationIterator
limit, pos, seq, start
Fields inherited from class com.ibm.icu.impl.coll.CollationIterator
data, NO_CP_AND_CE32, trie
-
Constructor Summary
ConstructorsConstructorDescriptionPartial constructor, seeCollationIterator(CollationData)
.FCDUTF16CollationIterator
(CollationData data, boolean numeric, CharSequence s, int p) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
backwardNumCodePoints
(int num) boolean
protected void
forwardNumCodePoints
(int num) int
protected long
Returns the next code point and its local CE32 value.int
hashCode()
int
Returns the next code point (with post-increment).private void
Extend the FCD text segment forward or normalize around pos.private void
normalize
(int from, int to) int
Returns the previous code point (with pre-decrement).private void
Extend the FCD text segment backward or normalize around pos.void
resetToOffset
(int newOffset) Resets the iterator state and sets the position to the specified offset.void
setText
(boolean numeric, CharSequence s, int p) private void
Switches to backward checking.private void
Switches to forward checking if possible.Methods inherited from class com.ibm.icu.impl.coll.UTF16CollationIterator
handleGetTrailSurrogate
Methods inherited from class com.ibm.icu.impl.coll.CollationIterator
appendCEsFromCE32, clearCEs, clearCEsIfNoneRemaining, fetchCEs, forbidSurrogateCodePoints, getCE, getCE32FromBuilderData, getCEs, getCEsLength, getDataCE32, isLeadSurrogate, isTrailSurrogate, makeCodePointAndCE32Pair, nextCE, previousCE, reset, reset, setCurrentCE
-
Field Details
-
rawSeq
-
rawStart
private static final int rawStart- See Also:
-
segmentStart
private int segmentStart -
segmentLimit
private int segmentLimit -
rawLimit
private int rawLimit -
nfcImpl
-
normalized
-
checkDir
private int checkDir
-
-
Constructor Details
-
FCDUTF16CollationIterator
Partial constructor, seeCollationIterator(CollationData)
. -
FCDUTF16CollationIterator
-
-
Method Details
-
equals
- Overrides:
equals
in classUTF16CollationIterator
-
hashCode
public int hashCode()- Overrides:
hashCode
in classUTF16CollationIterator
-
resetToOffset
public void resetToOffset(int newOffset) Description copied from class:CollationIterator
Resets the iterator state and sets the position to the specified offset. Subclasses must implement, and must call the parent class method, or CollationIterator.reset().- Overrides:
resetToOffset
in classUTF16CollationIterator
-
getOffset
public int getOffset()- Overrides:
getOffset
in classUTF16CollationIterator
-
setText
- Overrides:
setText
in classUTF16CollationIterator
-
nextCodePoint
public int nextCodePoint()Description copied from class:CollationIterator
Returns the next code point (with post-increment). Public for identical-level comparison and for testing.- Overrides:
nextCodePoint
in classUTF16CollationIterator
-
previousCodePoint
public int previousCodePoint()Description copied from class:CollationIterator
Returns the previous code point (with pre-decrement). Public for identical-level comparison and for testing.- Overrides:
previousCodePoint
in classUTF16CollationIterator
-
handleNextCE32
protected long handleNextCE32()Description copied from class:CollationIterator
Returns the next code point and its local CE32 value. Returns Collation.FALLBACK_CE32 at the end of the text (c<0) or when c's CE32 value is to be looked up in the base data (fallback). The code point is used for fallbacks, context and implicit weights. It is ignored when the returned CE32 is not special (e.g., FFFD_CE32). Returns the code point in bits 63..32 (signed) and the CE32 in bits 31..0.- Overrides:
handleNextCE32
in classUTF16CollationIterator
-
forwardNumCodePoints
protected void forwardNumCodePoints(int num) - Overrides:
forwardNumCodePoints
in classUTF16CollationIterator
-
backwardNumCodePoints
protected void backwardNumCodePoints(int num) - Overrides:
backwardNumCodePoints
in classUTF16CollationIterator
-
switchToForward
private void switchToForward()Switches to forward checking if possible. To be called when checkDir < 0 || (checkDir == 0 && pos == limit). Returns with checkDir > 0 || (checkDir == 0 && pos != limit). -
nextSegment
private void nextSegment()Extend the FCD text segment forward or normalize around pos. To be called when checkDir > 0 && pos != limit. Returns with checkDir == 0 and pos != limit. -
switchToBackward
private void switchToBackward()Switches to backward checking. To be called when checkDir > 0 || (checkDir == 0 && pos == start). Returns with checkDir < 0 || (checkDir == 0 && pos != start). -
previousSegment
private void previousSegment()Extend the FCD text segment backward or normalize around pos. To be called when checkDir < 0 && pos != start. Returns with checkDir == 0 and pos != start. -
normalize
private void normalize(int from, int to)
-