/** * Removes the specified character from this set if it is present. * The set will not contain the specified character once the call * returns. * @param c the character to be removed * @return this object, for chaining * @stable ICU 2.0 */ public final UnicodeSet remove(int c) { return remove(c, c); }
/** * @see #removeAll(com.ibm.icu.text.UnicodeSet) * @stable ICU 4.4 */ public <T extends CharSequence> UnicodeSet removeAll(Iterable<T> collection) { checkFrozen(); for (T o : collection) { remove(o); } return this; }
/** * Removes the specified string from this set if it is present. * The set will not contain the specified string once the call * returns. * @param s the string to be removed * @return this object, for chaining * @stable ICU 2.0 */ public final UnicodeSet remove(CharSequence s) { int cp = getSingleCP(s); if (cp < 0) { strings.remove(s.toString()); pat = null; } else { remove(cp, cp); } return this; }
@Override protected UnicodeSet set(int value) { // See https://ssl.icu-project.org/trac/ticket/13462 UnicodeSet set = super.set(value); switch (value) { case UScript.COMMON: set.add(0x3000); set.add(0x3004); set.add(0x3012); set.add(0x3020); set.add(0x3036); break; case UScript.BOPOMOFO: case UScript.HAN: case UScript.HANGUL: case UScript.HIRAGANA: case UScript.KATAKANA: case UScript.YI: set.remove(0x3000); set.remove(0x3004); set.remove(0x3012); set.remove(0x3020); set.remove(0x3036); break; } return set; } };
scriptSet.remove(UCharacter.toString(charId));
void suppressContractions(UnicodeSet set) { if(set.isEmpty()) { return; } UnicodeSetIterator iter = new UnicodeSetIterator(set); while(iter.next() && iter.codepoint != UnicodeSetIterator.IS_STRING) { int c = iter.codepoint; int ce32 = trie.get(c); if(ce32 == Collation.FALLBACK_CE32) { ce32 = base.getFinalCE32(base.getCE32(c)); if(Collation.ce32HasContext(ce32)) { ce32 = copyFromBaseCE32(c, ce32, false /* without context */); trie.set(c, ce32); } } else if(isBuilderContextCE32(ce32)) { ce32 = getConditionalCE32ForCE32(ce32).ce32; // Simply abandon the list of ConditionalCE32. // The caller will copy this builder in the end, // eliminating unreachable data. trie.set(c, ce32); contextChars.remove(c); } } modified = true; }
optimizeSet.remove(Hangul.HANGUL_BASE, Hangul.HANGUL_END); dataBuilder.optimize(optimizeSet); tailoring.ensureOwnedData();