Class FCDUTF16CollationIterator


  • public final class FCDUTF16CollationIterator
    extends UTF16CollationIterator
    Incrementally checks the input text for FCD and normalizes where necessary.
    • Field Detail

      • rawSeq

        private java.lang.CharSequence rawSeq
      • segmentStart

        private int segmentStart
      • segmentLimit

        private int segmentLimit
      • rawLimit

        private int rawLimit
      • normalized

        private java.lang.StringBuilder normalized
      • checkDir

        private int checkDir
    • Method Detail

      • 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 class UTF16CollationIterator
      • 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 class UTF16CollationIterator
      • 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)