Package com.ibm.icu.util

Examples of com.ibm.icu.util.CaseInsensitiveString


     */
    public void remove(String ID) {
        String[] stv = TransliteratorIDParser.IDtoSTV(ID);
        // Only need to do this if ID.indexOf('-') < 0
        String id = TransliteratorIDParser.STVtoID(stv[0], stv[1], stv[2]);
        registry.remove(new CaseInsensitiveString(id));
        removeSTV(stv[0], stv[1], stv[2]);
        availableIDs.removeElement(new CaseInsensitiveString(id));
    }
View Full Code Here


     * as well, that is, Any-inverseTarget.getInverse() => Any-target
     */
    public static void registerSpecialInverse(String target,
                                              String inverseTarget,
                                              boolean bidirectional) {
        SPECIAL_INVERSES.put(new CaseInsensitiveString(target), inverseTarget);
        if (bidirectional && !target.equalsIgnoreCase(inverseTarget)) {
            SPECIAL_INVERSES.put(new CaseInsensitiveString(inverseTarget), target);
        }
    }
View Full Code Here

     */
    private static SingleID specsToSpecialInverse(Specs specs) {
        if (!specs.source.equalsIgnoreCase(ANY)) {
            return null;
        }
        String inverseTarget = SPECIAL_INVERSES.get(new CaseInsensitiveString(specs.target));
        if (inverseTarget != null) {
            // If the original ID contained "Any-" then make the
            // special inverse "Any-Foo"; otherwise make it "Foo".
            // So "Any-NFC" => "Any-NFD" but "NFC" => "NFD".
            StringBuilder buf = new StringBuilder();
View Full Code Here

     * as well, that is, Any-inverseTarget.getInverse() => Any-target
     */
    public static void registerSpecialInverse(String target,
                                              String inverseTarget,
                                              boolean bidirectional) {
        SPECIAL_INVERSES.put(new CaseInsensitiveString(target), inverseTarget);
        if (bidirectional && !target.equalsIgnoreCase(inverseTarget)) {
            SPECIAL_INVERSES.put(new CaseInsensitiveString(inverseTarget), target);
        }
    }
View Full Code Here

    private static SingleID specsToSpecialInverse(Specs specs) {
        if (!specs.source.equalsIgnoreCase(ANY)) {
            return null;
        }
        String inverseTarget = (String) SPECIAL_INVERSES.get(
            new CaseInsensitiveString(specs.target));
        if (inverseTarget != null) {
            // If the original ID contained "Any-" then make the
            // special inverse "Any-Foo"; otherwise make it "Foo".
            // So "Any-NFC" => "Any-NFD" but "NFC" => "NFD".
            StringBuffer buf = new StringBuffer();
View Full Code Here

   */
  public void remove(final String ID) {
    String[] stv = TransliteratorIDParser.IDtoSTV(ID);
    // Only need to do this if ID.indexOf('-') < 0
    String id = TransliteratorIDParser.STVtoID(stv[0], stv[1], stv[2]);
    registry.remove(new CaseInsensitiveString(id));
    removeSTV(stv[0], stv[1], stv[2]);
    availableIDs.remove(new CaseInsensitiveString(id));
  }
View Full Code Here

   * Returns an enumeration over visible target names for the given source.
   *
   * @return An <code>Enumeration</code> over <code>String</code> objects
   */
  public Enumeration<String> getAvailableTargets(final String source) {
    CaseInsensitiveString cisrc = new CaseInsensitiveString(source);
    Map<CaseInsensitiveString, List<CaseInsensitiveString>> targets = specDAG.get(cisrc);
    if (targets == null) {
      return new IDEnumeration(null);
    }
    return new IDEnumeration(Collections.enumeration(targets.keySet()));
View Full Code Here

   * Returns an enumeration over visible variant names for the given source and target.
   *
   * @return An <code>Enumeration</code> over <code>String</code> objects
   */
  public Enumeration<String> getAvailableVariants(final String source, final String target) {
    CaseInsensitiveString cisrc = new CaseInsensitiveString(source);
    CaseInsensitiveString citrg = new CaseInsensitiveString(target);
    Map<CaseInsensitiveString, List<CaseInsensitiveString>> targets = specDAG.get(cisrc);
    if (targets == null) {
      return new IDEnumeration(null);
    }
    List<CaseInsensitiveString> variants = targets.get(citrg);
View Full Code Here

  /**
   * Register an entry object (adopted) with the given ID, source, target, and variant strings.
   */
  private void registerEntry(final String ID, final String source, final String target, final String variant, final Object entry,
      final boolean visible) {
    CaseInsensitiveString ciID = new CaseInsensitiveString(ID);
    Object[] arrayOfObj;

    // Store the entry within an array so it can be modified later
    if (entry instanceof Object[]) {
      arrayOfObj = (Object[]) entry;
View Full Code Here

   * the special variant NO_VARIANT is stored in slot zero of the UVector of variants.
   */
  private void registerSTV(final String source, final String target, final String variant) {
    // assert(source.length() > 0);
    // assert(target.length() > 0);
    CaseInsensitiveString cisrc = new CaseInsensitiveString(source);
    CaseInsensitiveString citrg = new CaseInsensitiveString(target);
    CaseInsensitiveString civar = new CaseInsensitiveString(variant);
    Map<CaseInsensitiveString, List<CaseInsensitiveString>> targets = specDAG.get(cisrc);
    if (targets == null) {
      targets = Collections.synchronizedMap(new HashMap<CaseInsensitiveString, List<CaseInsensitiveString>>());
      specDAG.put(cisrc, targets);
    }
View Full Code Here

TOP

Related Classes of com.ibm.icu.util.CaseInsensitiveString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.