Package com.ibm.icu.text

Examples of com.ibm.icu.text.CollationKey.toByteArray()


    return sb;
  }
  private static byte[] getSortByteArray (String term)
  {
    CollationKey colKey = col.getCollationKey(term);
    return colKey.toByteArray();
    //RawCollationKey rawKey = col.getRawCollationKey(term, null);
    //byte[] byt2= rawKey.releaseBytes();
   }
 
  /*
 
View Full Code Here


    return sb;
  }
  private static byte[] getSortByteArray (String term)
  {
    CollationKey colKey = col.getCollationKey(term);
    return colKey.toByteArray();
  }
 
  public static byte[] getSortBytes (String term)
  {
    byte[] bytes = getSortByteArray(term);       //    bytes (with trailing x'00')
View Full Code Here

     */
    public void testToByteArray() {
        Collator c = Collator.getInstance();
        c.setStrength(Collator.PRIMARY);
        CollationKey k1 = c.getCollationKey("This");
        byte[] key = k1.toByteArray();
        assertNotNull(key);
        assertTrue(0 < key.length);
    }
}
View Full Code Here

                    for (int j = 0; j < i; j ++) {
                        CollationKey key2 = coll.getCollationKey(tokens[j]);
                        if (key2.compareTo(key1) < 0) {
                            errln("Setting variable top shouldn't change the comparison sequence");
                        }
                        byte sortorder[] = key2.toByteArray();
                        if (sortorder.length > 0
                            && (key2.toByteArray())[0] > 1) {
                            errln("Primary sort order should be 0");
                        }
                    }
View Full Code Here

                        if (key2.compareTo(key1) < 0) {
                            errln("Setting variable top shouldn't change the comparison sequence");
                        }
                        byte sortorder[] = key2.toByteArray();
                        if (sortorder.length > 0
                            && (key2.toByteArray())[0] > 1) {
                            errln("Primary sort order should be 0");
                        }
                    }
                } catch (Exception e) {
                    CollationElementIterator iter
View Full Code Here

            logln("Test rule["+i+"]"+rules[i]);
           
            CollationKey keyA = coll.getCollationKey("a");
            logln("Key for \"a\":"+  prettify(keyA));
            byte[] keyAInBytes = keyA.toByteArray();
            for (int j=0; j<keyAInBytes.length && j<secIgnKey.length; j++) {
                if (keyAInBytes[j]!=secIgnKey[j]) {
                    if ((char)keyAInBytes[j]<=(char)secIgnKey[j]) {
                        logln("Error! String \"a\" must be greater than [Last Secondary Ignorable]");
                    }
View Full Code Here

                CollationKey key = coll.getCollationKey(firstVariable);
                logln("Collation key for 0x0009: "+prettify(key));
            }
            CollationKey keyB = coll.getCollationKey("b");
            logln("Key for \"b\":"+  prettify(keyB));
            byte[] keyBInBytes = keyB.toByteArray();
            for (int j=0; j<keyBInBytes.length && j<secIgnKey.length; j++) {
                if (keyBInBytes[j]!=secIgnKey[j]) {
                    if ((char)keyBInBytes[j]<=(char)secIgnKey[j]) {
                        errln("Error! String \"b\" must be greater than [Last Secondary Ignorable]");
                    }
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.