1cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes/** 2cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes******************************************************************************* 3cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes* Copyright (C) 1996-2005, International Business Machines Corporation and * 4cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes* others. All Rights Reserved. * 5cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes******************************************************************************* 6cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes* 7cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes* 8cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes******************************************************************************* 9cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes*/ 10cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes 11cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughespackage libcore.icu; 12cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes 13a94266074c7b82720fd2cecfb37ab8da85f1b296Elliott Hughesimport java.util.Locale; 14a94266074c7b82720fd2cecfb37ab8da85f1b296Elliott Hughes 15cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes/** 16cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes* Package static class for declaring all native methods for collation use. 17cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes* @author syn wee quek 18cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes* @internal ICU 2.4 19cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes*/ 20cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughespublic final class NativeCollation { 21cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes private NativeCollation() { 22cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes } 23cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes 24cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes // Collator. 251e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native void closeCollator(long address); 261e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native int compare(long address, String source, String target); 271e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native int getAttribute(long address, int type); 28df40b4ad7268a13dff0852f70451a48b59149221Elliott Hughes public static native long getCollationElementIterator(long address, String source); 291e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native String getRules(long address); 301e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native byte[] getSortKey(long address, String source); 31a94266074c7b82720fd2cecfb37ab8da85f1b296Elliott Hughes public static long openCollator(Locale locale) { 32a94266074c7b82720fd2cecfb37ab8da85f1b296Elliott Hughes return openCollator(locale.toLanguageTag()); 33a94266074c7b82720fd2cecfb37ab8da85f1b296Elliott Hughes } 34a94266074c7b82720fd2cecfb37ab8da85f1b296Elliott Hughes private static native long openCollator(String languageTag); 351e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native long openCollatorFromRules(String rules, int normalizationMode, int collationStrength); 361e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native long safeClone(long address); 371e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native void setAttribute(long address, int type, int value); 38cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes 39cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes // CollationElementIterator. 401e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native void closeElements(long address); 411e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native int getMaxExpansion(long address, int order); 421e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native int getOffset(long address); 431e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native int next(long address); 441e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native int previous(long address); 451e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native void reset(long address); 461e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native void setOffset(long address, int offset); 471e5d730e58d94c3bfa14b7dde5ab3981fe5a170bElliott Hughes public static native void setText(long address, String source); 48cfa6ffebf3a63db7a125c4d9abe7e661fac5cc1fElliott Hughes} 49