public String getRawDecomposition ( int c ) { // We do not loop in this method because an algorithmic mapping itself // becomes a final result rather than having to be decomposed recursively. int norm16 ; if ( c < minDecompNoCP || isDecompYes ( norm16 = getNorm16 ( c ) ) ) { // c does not decompose return null ; } else if ( isHangul ( norm16 ) ) { // Hangul syllable: decompose algorithmically StringBuilder buffer = new StringBuilder ( ) ; Hangul . getRawDecomposition ( c , buffer ) ; return buffer . toString ( ) ; } else if ( isDecompNoAlgorithmic ( norm16 ) ) { return UTF16 . valueOf ( mapAlgorithmic ( c , norm16 ) ) ; } else { // c decomposes, get everything from the variable-length extra data int firstUnit = extraData . charAt ( norm16 ) ; int mLength = firstUnit & MAPPING_LENGTH_MASK ; // length of normal mapping if ( ( firstUnit & MAPPING_HAS_RAW_MAPPING ) != 0 ) { // Read the raw mapping from before the firstUnit and before the optional ccc/lccc word. // Bit 7=MAPPING_HAS_CCC_LCCC_WORD int rawMapping = norm16 - ( ( firstUnit >> 7 ) & 1 ) - 1 ; char rm0 = extraData . charAt ( rawMapping ) ; if ( rm0 <= MAPPING_LENGTH_MASK ) { return extraData . substring ( rawMapping - rm0 , rawMapping ) ; } else { // Copy the normal mapping and replace its first two code units with rm0. StringBuilder buffer = new StringBuilder ( mLength - 1 ) . append ( rm0 ) ; norm16 += 1 + 2 ; // skip over the firstUnit and the first two mapping code units return buffer . append ( extraData , norm16 , norm16 + mLength - 2 ) . toString ( ) ; } } else { norm16 += 1 ; // skip over the firstUnit return extraData . substring ( norm16 , norm16 + mLength ) ; } } }
Gets the raw decomposition for one code point .