Class CaseMapImpl

java.lang.Object
com.ibm.icu.impl.CaseMapImpl

public final class CaseMapImpl extends Object
  • Field Details

    • TITLECASE_WHOLE_STRING

      public static final int TITLECASE_WHOLE_STRING
      See Also:
    • TITLECASE_SENTENCES

      public static final int TITLECASE_SENTENCES
      See Also:
    • TITLECASE_ITERATOR_MASK

      private static final int TITLECASE_ITERATOR_MASK
      Bit mask for the titlecasing iterator options bit field. Currently only 3 out of 8 values are used: 0 (words), TITLECASE_WHOLE_STRING, TITLECASE_SENTENCES. See stringoptions.h.
      See Also:
    • TITLECASE_ADJUST_TO_CASED

      public static final int TITLECASE_ADJUST_TO_CASED
      See Also:
    • TITLECASE_ADJUSTMENT_MASK

      private static final int TITLECASE_ADJUSTMENT_MASK
      Bit mask for the titlecasing index adjustment options bit set. Currently two bits are defined: TITLECASE_NO_BREAK_ADJUSTMENT, TITLECASE_ADJUST_TO_CASED. See stringoptions.h.
      See Also:
    • ACUTE

      private static final char ACUTE
      See Also:
    • U_GC_M_MASK

      private static final int U_GC_M_MASK
      See Also:
    • LNS

      private static final int LNS
      See Also:
    • OMIT_UNCHANGED_TEXT

      public static final int OMIT_UNCHANGED_TEXT
      Omit unchanged text when case-mapping with Edits.
      See Also:
    • CASE_TRIE

      private static final Trie2_16 CASE_TRIE
  • Constructor Details

    • CaseMapImpl

      public CaseMapImpl()
  • Method Details

    • addTitleAdjustmentOption

      public static int addTitleAdjustmentOption(int options, int newOption)
    • isLNS

      private static boolean isLNS(int c)
    • addTitleIteratorOption

      public static int addTitleIteratorOption(int options, int newOption)
    • getTitleBreakIterator

      public static BreakIterator getTitleBreakIterator(Locale locale, int options, BreakIterator iter)
    • getTitleBreakIterator

      public static BreakIterator getTitleBreakIterator(ULocale locale, int options, BreakIterator iter)
    • appendCodePoint

      private static int appendCodePoint(Appendable a, int c) throws IOException
      Throws:
      IOException
    • appendResult

      private static void appendResult(int result, Appendable dest, int cpLength, int options, Edits edits) throws IOException
      Appends a full case mapping result, see UCaseProps.MAX_STRING_LENGTH.
      Throws:
      IOException
    • appendUnchanged

      private static final void appendUnchanged(CharSequence src, int start, int length, Appendable dest, int options, Edits edits) throws IOException
      Throws:
      IOException
    • applyEdits

      private static String applyEdits(CharSequence src, StringBuilder replacementChars, Edits edits)
    • internalToLower

      private static void internalToLower(int caseLocale, int options, CharSequence src, int srcStart, int srcLimit, CaseMapImpl.StringContextIterator iter, Appendable dest, Edits edits) throws IOException
      caseLocale >= 0: Lowercases [srcStart..srcLimit[ but takes context [0..srcLength[ into account. caseLocale invalid input: '<' 0: Case-folds [srcStart..srcLimit[.
      Throws:
      IOException
    • internalToUpper

      private static void internalToUpper(int caseLocale, int options, CharSequence src, Appendable dest, Edits edits) throws IOException
      Throws:
      IOException
    • toLower

      public static String toLower(int caseLocale, int options, CharSequence src)
    • toLower

      public static <A extends Appendable> A toLower(int caseLocale, int options, CharSequence src, A dest, Edits edits)
    • toUpper

      public static String toUpper(int caseLocale, int options, CharSequence src)
    • toUpper

      public static <A extends Appendable> A toUpper(int caseLocale, int options, CharSequence src, A dest, Edits edits)
    • toTitle

      public static String toTitle(int caseLocale, int options, BreakIterator iter, CharSequence src)
    • toTitle

      public static <A extends Appendable> A toTitle(int caseLocale, int options, BreakIterator titleIter, CharSequence src, A dest, Edits edits)
    • maybeTitleDutchIJ

      private static <A extends Appendable> int maybeTitleDutchIJ(CharSequence src, int c, int start, int segmentLimit, A dest, int options, Edits edits) throws IOException
      Input: c is a letter I with or without acute accent. start is the index in src after c, and is less than segmentLimit. If a plain i/I is followed by a plain j/J, or an i/I with acute (precomposed or decomposed) is followed by a j/J with acute, then we output accordingly.
      Returns:
      the src index after the titlecased sequence, or the start index if no Dutch IJ
      Throws:
      IOException
    • fold

      public static String fold(int options, CharSequence src)
    • fold

      public static <A extends Appendable> A fold(int options, CharSequence src, A dest, Edits edits)