public static final int getScriptExtensions(int c, BitSet set) {
        set.clear();
        int scriptX=UCharacterProperty.INSTANCE.getAdditional(c, 0)&UCharacterProperty.SCRIPT_X_MASK;
        if(scriptX<UCharacterProperty.SCRIPT_X_WITH_COMMON) {
            set.set(scriptX);
            return scriptX;
        }

        char[] scriptExtensions=UCharacterProperty.INSTANCE.m_scriptExtensions_;
        int scx=scriptX&UCharacterProperty.SCRIPT_MASK_;  // index into scriptExtensions
        if(scriptX>=UCharacterProperty.SCRIPT_X_WITH_OTHER) {
            scx=scriptExtensions[scx+1];
        }
        int length=0;
        int sx;
        do {
            sx=scriptExtensions[scx++];
            set.set(sx&0x7fff);
            ++length;
        } while(sx<0x8000);
        // length==set.cardinality()
        return -length;
    }
public static final int getScriptExtensions ( int c , BitSet set ) { set . clear ( ) ; int scriptX = UCharacterProperty . INSTANCE . getAdditional ( c , 0 ) & UCharacterProperty . SCRIPT_X_MASK ; if ( scriptX < UCharacterProperty . SCRIPT_X_WITH_COMMON ) { set . set ( scriptX ) ; return scriptX ; } char [ ] scriptExtensions = UCharacterProperty . INSTANCE . m_scriptExtensions_ ; int scx = scriptX & UCharacterProperty . SCRIPT_MASK_ ; if ( scriptX >= UCharacterProperty . SCRIPT_X_WITH_OTHER ) { scx = scriptExtensions [ scx + 1 ] ; } int length = 0 ; int sx ; do { sx = scriptExtensions [ scx ++ ] ; set . set ( sx & 0x7fff ) ; ++ length ; } while ( sx < 0x8000 ) ; return - length ; }
Sets code point c's Script_Extensions as script code integers into the output BitSet.
<ul>
<li>If c does have Script_Extensions, then the return value is
the negative number of Script_Extensions codes (= -set.cardinality());
in this case, the Script property value
(normally Common or Inherited) is not included in the set.
<li>If c does not have Script_Extensions, then the one Script code is put into the set
and also returned.
<li>If c is not a valid code point, then the one {@link #UNKNOWN} code is put into the set
and also returned.
</ul>
In other words, if the return value is non-negative, it is c's single Script code
and the set contains exactly this Script code.
If the return value is -n, then the set contains c's n&gt;=2 Script_Extensions script codes.

<p>Some characters are commonly used in multiple scripts.
For more information, see UAX #24: http://www.unicode.org/reports/tr24/.

@param c code point
@param set set of script code integers; will be cleared, then bits are set
corresponding to c's Script_Extensions
@return negative number of script codes in c's Script_Extensions,
or the non-negative single Script value