private void getNumerics ( String input , UnicodeSet result ) { result . clear ( ) ; for ( int utf16Offset = 0 ; utf16Offset < input . length ( ) ; ) { int codePoint = Character . codePointAt ( input , utf16Offset ) ; utf16Offset += Character . charCount ( codePoint ) ; // Store a representative character for each kind of decimal digit if ( UCharacter . getType ( codePoint ) == UCharacterCategory . DECIMAL_DIGIT_NUMBER ) { // Store the zero character as a representative for comparison. // Unicode guarantees it is codePoint - value result . add ( codePoint - UCharacter . getNumericValue ( codePoint ) ) ; } } }
Computes the set of numerics for a string according to UTS 39 section 5 . 3 .