Examples of CollationKey


Examples of java.text.CollationKey

   *       1 - this > str2
   */
  protected int stringCollatorCompare(SQLChar str2)
    throws StandardException
 
    CollationKey ckey1 = this.getCollationKey();
    CollationKey ckey2 = str2.getCollationKey();

   
    /*
    ** By convention, nulls sort High, and null == null
    */
 
View Full Code Here

Examples of java.text.CollationKey

   * Implementation of hashCode() for the national character types,
   * put here to make it accessible to all the national types.
   */
  protected int nationalHashCode()
  {
    CollationKey tmpCKey = null;

    try
    {
      tmpCKey = getCollationKey();
    }
    catch (StandardException se)
    {
      if (SanityManager.DEBUG)
      {
        SanityManager.THROWASSERT("Unexpected exception", se);
      }
    }

    if (tmpCKey == null)
      return 0;
    return tmpCKey.hashCode();
  }
View Full Code Here

Examples of java.text.CollationKey

      String Simple = "< a< b< c< d";
      rbc = new RuleBasedCollator(Simple);
    } catch (ParseException e) {
      fail("Assert 0: Unexpected format exception " + e);
    }
    CollationKey ck = rbc.getCollationKey(source);
    assertNull("Assert 1: getCollationKey (null) does not return null", ck);
  }
View Full Code Here

Examples of java.text.CollationKey

    public void testGetCollationKey() {
        RuleBasedCollator coll = (RuleBasedCollator) Collator
                .getInstance(Locale.GERMAN);
        String source = "abc";
        CollationKey key1 = coll.getCollationKey(source);
        assertEquals(source, key1.getSourceString());
        String source2 = "abb";
        CollationKey key2 = coll.getCollationKey(source2);
        assertEquals(source2, key2.getSourceString());
        assertTrue(key1.compareTo(key2) > 0);
        assertTrue(coll.compare(source, source2) > 0);

    }
View Full Code Here

Examples of java.text.CollationKey

    // Test CollationKey
    public void testCollationKey() {
        Collator coll = Collator.getInstance(Locale.US);
        String text = "abc";
        CollationKey key = coll.getCollationKey(text);
        key.hashCode();

        CollationKey key2 = coll.getCollationKey("abc");

        assertEquals(0, key.compareTo(key2));
    }
View Full Code Here

Examples of java.text.CollationKey

    int result;


    if (comparator instanceof Collator) {
      CollationKey collationKey1
          = ((Collator) comparator).getCollationKey(obj1.toString());
      CollationKey collationKey2
          = ((Collator) comparator).getCollationKey(obj2.toString());
      result = collationKey1.compareTo(collationKey2);

    } else if (comparator != null) {
      result = comparator.compare(obj1, obj2);
View Full Code Here

Examples of java.text.CollationKey

            a = a.toUpperCase();
            b = b.toUpperCase();
        }
        int comp;
        if (collationKeys != null) {
            CollationKey aKey = getKey(a);
            CollationKey bKey = getKey(b);
            comp = aKey.compareTo(bKey);
        } else {
            comp = collator.compare(a, b);
        }
        return comp;
View Full Code Here

Examples of java.text.CollationKey

        return compareString(a.substring(ai, ai + 1), b.substring(bi, bi + 1), ignoreCase) == 0;
    }

    private CollationKey getKey(String a) {
        synchronized (collationKeys) {
            CollationKey key = collationKeys.get(a);
            if (key == null) {
                key = collator.getCollationKey(a);
                collationKeys.put(a, key);
            }
            return key;
View Full Code Here

Examples of java.text.CollationKey

            a = a.toUpperCase();
            b = b.toUpperCase();
        }
        int comp;
        if (collationKeys != null) {
            CollationKey aKey = getKey(a);
            CollationKey bKey = getKey(b);
            comp = aKey.compareTo(bKey);
        } else {
            comp = collator.compare(a, b);
        }
        return comp;
View Full Code Here

Examples of java.text.CollationKey

        return compareString(a.substring(ai, ai + 1), b.substring(bi, bi + 1), ignoreCase) == 0;
    }

    private CollationKey getKey(String a) {
        synchronized (collationKeys) {
            CollationKey key = collationKeys.get(a);
            if (key == null) {
                key = collator.getCollationKey(a);
                collationKeys.put(a, key);
            }
            return key;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.