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
-
public final class FCDUTF16CollationIterator extends UTF16CollationIterator
Incrementally checks the input text for FCD and normalizes where necessary.
-
-
Field Summary
Fields Modifier and Type Field Description private int
checkDir
private Normalizer2Impl
nfcImpl
private java.lang.StringBuilder
normalized
private int
rawLimit
private java.lang.CharSequence
rawSeq
private static int
rawStart
private int
segmentLimit
private int
segmentStart
-
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
Constructors Constructor Description FCDUTF16CollationIterator(CollationData d)
Partial constructor, seeCollationIterator(CollationData)
.FCDUTF16CollationIterator(CollationData data, boolean numeric, java.lang.CharSequence s, int p)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
backwardNumCodePoints(int num)
boolean
equals(java.lang.Object other)
protected void
forwardNumCodePoints(int num)
int
getOffset()
protected long
handleNextCE32()
Returns the next code point and its local CE32 value.int
hashCode()
int
nextCodePoint()
Returns the next code point (with post-increment).private void
nextSegment()
Extend the FCD text segment forward or normalize around pos.private void
normalize(int from, int to)
int
previousCodePoint()
Returns the previous code point (with pre-decrement).private void
previousSegment()
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, java.lang.CharSequence s, int p)
private void
switchToBackward()
Switches to backward checking.private void
switchToForward()
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 Detail
-
rawSeq
private java.lang.CharSequence rawSeq
-
rawStart
private static final int rawStart
- See Also:
- Constant Field Values
-
segmentStart
private int segmentStart
-
segmentLimit
private int segmentLimit
-
rawLimit
private int rawLimit
-
nfcImpl
private final Normalizer2Impl nfcImpl
-
normalized
private java.lang.StringBuilder normalized
-
checkDir
private int checkDir
-
-
Constructor Detail
-
FCDUTF16CollationIterator
public FCDUTF16CollationIterator(CollationData d)
Partial constructor, seeCollationIterator(CollationData)
.
-
FCDUTF16CollationIterator
public FCDUTF16CollationIterator(CollationData data, boolean numeric, java.lang.CharSequence s, int p)
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object other)
- 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
public void setText(boolean numeric, java.lang.CharSequence s, int p)
- 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)
-
-