Class FCDUTF16CollationIterator


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

    • rawSeq

      private CharSequence rawSeq
    • rawStart

      private static final int rawStart
      See Also:
    • segmentStart

      private int segmentStart
    • segmentLimit

      private int segmentLimit
    • rawLimit

      private int rawLimit
    • nfcImpl

      private final Normalizer2Impl nfcImpl
    • normalized

      private StringBuilder normalized
    • checkDir

      private int checkDir
  • Constructor Details

  • Method Details

    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class UTF16CollationIterator
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class UTF16CollationIterator
    • 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
    • getOffset

      public int getOffset()
      Overrides:
      getOffset in class UTF16CollationIterator
    • setText

      public void setText(boolean numeric, CharSequence s, int p)
      Overrides:
      setText in class UTF16CollationIterator
    • 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 class UTF16CollationIterator
    • 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 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
    • forwardNumCodePoints

      protected void forwardNumCodePoints(int num)
      Overrides:
      forwardNumCodePoints in class UTF16CollationIterator
    • backwardNumCodePoints

      protected void backwardNumCodePoints(int num)
      Overrides:
      backwardNumCodePoints 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)