public UnhandledBreakEngine() { for (int i = 0; i < fHandled.length; i++) { fHandled[i] = new UnicodeSet(); } }
/** * {@icu} Returns a UnicodeSet that contains all the characters and sequences tailored * in this collator. * @return a pointer to a UnicodeSet object containing all the * code points and sequences that may sort differently than * in the root collator. * @stable ICU 2.4 */ public UnicodeSet getTailoredSet() { return new UnicodeSet(0, 0x10FFFF); }
public static UnicodeSet letterOrDigitUnicodeSet() { return new UnicodeSet(LETTER_OR_DIGIT_PATTERN); } }
public static UnicodeSet letterOrDigitUnicodeSet() { return new UnicodeSet(LETTER_OR_DIGIT_PATTERN); } }
private static UnicodeSet subUnicodeSet(String pattern1, String pattern2) { UnicodeSet unicodeSet = new UnicodeSet(); unicodeSet.addAll(new UnicodeSet(pattern1)); unicodeSet.removeAll(new UnicodeSet(pattern2)); return unicodeSet; }
private static UnicodeSet subUnicodeSet(final String pattern1, final String pattern2) { final UnicodeSet unicodeSet = new UnicodeSet(); unicodeSet.addAll(new UnicodeSet(pattern1)); unicodeSet.removeAll(new UnicodeSet(pattern2)); return unicodeSet; }
ConfusabledataBuilder() { fTable = new Hashtable<Integer, SPUString>(); fKeySet = new UnicodeSet(); fKeyVec = new ArrayList<Integer>(); fValueVec = new ArrayList<Integer>(); stringPool = new SPUStringPool(); }
protected UnicodeSet set() { UnicodeSet set = new UnicodeSet(); set.applyIntPropertyValue(propertyId, 1); // 1 = True return set; }
/** * Return the stand-in for the dot set. It is allocated the first * time and reused thereafter. */ char getDotStandIn() { if (dotStandIn == -1) { dotStandIn = generateStandInFor(new UnicodeSet(DOT_SET)); } return (char) dotStandIn; }
/** * Clone a thawed version of this class, according to the Freezable interface. * @return the clone, not frozen * @stable ICU 4.4 */ @Override public UnicodeSet cloneAsThawed() { UnicodeSet result = new UnicodeSet(this); assert !result.isFrozen(); return result; }
/** * Makes a set from a multicharacter string. Thus "ch" => {"ch"} * <br><b>Warning: you cannot add an empty string ("") to a UnicodeSet.</b> * @param s the source string * @return a newly created set containing the given string * @stable ICU 2.0 */ public static UnicodeSet from(CharSequence s) { return new UnicodeSet().add(s); }
protected UnicodeSet set(int value) { UnicodeSet set = new UnicodeSet(); set.applyIntPropertyValue(propertyId, value); return set; }
/** * Create an iterator over nothing. <tt>next()</tt> and * <tt>nextRange()</tt> return false. This is a convenience * constructor allowing the target to be set later. * @stable ICU 2.0 */ public UnicodeSetIterator() { reset(new UnicodeSet()); }
/** * Makes a set from each of the characters in the string. Thus "ch" => {"c", "h"} * @param s the source string * @return a newly created set containing the given characters * @stable ICU 2.0 */ public static UnicodeSet fromAll(CharSequence s) { return new UnicodeSet().addAll(s); }
void addSourceTargetSet(UnicodeSet filter, UnicodeSet sourceSet, UnicodeSet targetSet) { UnicodeSet currentFilter = new UnicodeSet(filter); UnicodeSet revisiting = new UnicodeSet(); int count = ruleVector.size(); for (int i=0; i<count; ++i) { TransliterationRule r = ruleVector.get(i); r.addSourceTargetSet(currentFilter, sourceSet, targetSet, revisiting.clear()); currentFilter.addAll(revisiting); } }
/** * Parse a UnicodeSet out, store it, and return the stand-in character * used to represent it. */ private final char parseSet(String rule, ParsePosition pos) { UnicodeSet set = new UnicodeSet(rule, pos, parseData); if (variableNext >= variableLimit) { throw new RuntimeException("Private use variables exhausted"); } set.compact(); return generateStandInFor(set); }
/** * Temporary hack for registry problem. Needs to be replaced by better architecture. */ public Transliterator safeClone() { UnicodeFilter filter = getFilter(); if (filter != null && filter instanceof UnicodeSet) { filter = new UnicodeSet((UnicodeSet)filter); } return new AnyTransliterator(getID(), filter, target, targetScript, widthFix, cache); }
/** * Temporary hack for registry problem. Needs to be replaced by better architecture. */ public Transliterator safeClone() { UnicodeFilter filter = getFilter(); if (filter != null && filter instanceof UnicodeSet) { filter = new UnicodeSet((UnicodeSet)filter); } return new CompoundTransliterator(getID(), filter, trans, numAnonymousRBTs); } }
private void addScriptChars(ULocale locale, UnicodeSet allowedChars) { int scripts[] = UScript.getCode(locale); if (scripts != null) { UnicodeSet tmpSet = new UnicodeSet(); for (int i = 0; i < scripts.length; i++) { tmpSet.applyIntPropertyValue(UProperty.SCRIPT, scripts[i]); allowedChars.addAll(tmpSet); } } // else it's an unknown script. // Maybe they asked for the script of "zxx", which refers to no linguistic content. // Maybe they asked for the script of a newer locale that we don't know in the older version of ICU. }
/** * @see #retainAll(com.ibm.icu.text.UnicodeSet) * @stable ICU 4.4 */ public <T extends CharSequence> UnicodeSet retainAll(Iterable<T> collection) { checkFrozen(); // TODO optimize UnicodeSet toRetain = new UnicodeSet(); toRetain.addAll(collection); retainAll(toRetain); return this; }