1/**
2*******************************************************************************
3* Copyright (C) 1996-2005, International Business Machines Corporation and    *
4* others. All Rights Reserved.                                                *
5*******************************************************************************
6*
7*
8*******************************************************************************
9*/
10
11package libcore.icu;
12
13import java.util.Locale;
14
15/**
16* Package static class for declaring all native methods for collation use.
17* @author syn wee quek
18* @internal ICU 2.4
19*/
20public final class NativeCollation {
21    private NativeCollation() {
22    }
23
24    // Collator.
25    public static native void closeCollator(long address);
26    public static native int compare(long address, String source, String target);
27    public static native int getAttribute(long address, int type);
28    public static native long getCollationElementIterator(long address, String source);
29    public static native String getRules(long address);
30    public static native byte[] getSortKey(long address, String source);
31    public static long openCollator(Locale locale) {
32      return openCollator(locale.toLanguageTag());
33    }
34    private static native long openCollator(String languageTag);
35    public static native long openCollatorFromRules(String rules, int normalizationMode, int collationStrength);
36    public static native long safeClone(long address);
37    public static native void setAttribute(long address, int type, int value);
38
39    // CollationElementIterator.
40    public static native void closeElements(long address);
41    public static native int getMaxExpansion(long address, int order);
42    public static native int getOffset(long address);
43    public static native int next(long address);
44    public static native int previous(long address);
45    public static native void reset(long address);
46    public static native void setOffset(long address, int offset);
47    public static native void setText(long address, String source);
48}
49