FileDocCategorySizeDatePackage
NativeCollation.javaAPI DocAndroid 1.5 API8817Wed May 06 22:41:04 BST 2009com.ibm.icu4jni.text

NativeCollation

public final class NativeCollation extends Object
Package static class for declaring all native methods for collation use.
author
syn wee quek
internal
ICU 2.4

Fields Summary
Constructors Summary
public NativeCollation()

      
  
Methods Summary
static native voidcloseCollator(int collatoraddress)
Close a C collator Once closed, a UCollatorOld should not be used.

param
collatoraddress The UCollatorOld to close
internal
ICU 2.4

static native voidcloseElements(int address)
Close a C collation element iterator.

param
address of C collation element iterator to close.
internal
ICU 2.4

static native intcompare(int collatoraddress, java.lang.String source, java.lang.String target)
Compare two strings. The strings will be compared using the normalization mode and options specified in openCollator or openCollatorFromRules

param
collatoraddress address of the c collator
param
source The source string.
param
target The target string.
return
result of the comparison, Collation.EQUAL, Collation.GREATER or Collation.LESS
internal
ICU 2.4

static native intgetAttribute(int collatoraddress, int type)
Universal attribute getter

param
collatoraddress address of the C collator
param
type type of attribute to be set
return
attribute value
exception
RuntimeException thrown when error occurs while getting attribute value
internal
ICU 2.4

private static native intgetAvailableLocalesCountImpl()

static java.lang.String[]getAvailableLocalesImpl()

      int count =  getAvailableLocalesCountImpl();
      String[] result = new String[count];
      
      for(int i = 0; i < count; i++) {
          result[i] = getAvailableLocalesImpl(i);
      }
      return result;
  
private static native java.lang.StringgetAvailableLocalesImpl(int i)

static native intgetCollationElementIterator(int collatoraddress, java.lang.String source)
Create a CollationElementIterator object that will iterator over the elements in a string, using the collation rules defined in this RuleBasedCollator

param
collatoraddress address of C collator
param
source string to iterate over
return
address of C collationelementiterator
internal
ICU 2.4

static native intgetMaxExpansion(int address, int order)
Get the maximum length of any expansion sequences that end with the specified comparison order.

param
address of the C collation element iterator containing the text.
param
order collation order returned by previous or next.
return
maximum length of any expansion sequences ending with the specified order.
internal
ICU 2.4

static native intgetNormalization(int collatoraddress)
Get the normalization mode for this object. The normalization mode influences how strings are compared.

param
collatoraddress
return
normalization mode; one of the values from Normalization
internal
ICU 2.4

static native intgetOffset(int address)
Get the offset of the current source character. This is an offset into the text of the character containing the current collation elements.

param
address of the C collation elements iterator to query.
return
offset of the current source character.
internal
ICU 2.4

static native java.lang.StringgetRules(int collatoraddress)
Get the collation rules from a UCollator. The rules will follow the rule syntax.

param
collatoraddress the address of the C collator
return
collation rules.
internal
ICU 2.4

static native byte[]getSortKey(int collatoraddress, java.lang.String source)
Get a sort key for the argument string Sort keys may be compared using java.util.Arrays.equals

param
collatoraddress address of the C collator
param
source string for key to be generated
return
sort key
internal
ICU 2.4

static native inthashCode(int collatoraddress)
Returns a hash of this collation object

param
collatoraddress address of C collator
return
hash of this collation object
internal
ICU 2.4

static native intnext(int address)
Get the ordering priority of the next collation element in the text. A single character may contain more than one collation element.

param
address if C collation elements containing the text.
return
next collation elements ordering, or NULLORDER if the end of the text is reached.
internal
ICU 2.4

static native intopenCollator()
Method to create a new C Collator using the default locale rules.

return
new c collator
internal
ICU 2.4

static native intopenCollator(java.lang.String locale)
Method to create a new C Collator using the argument locale rules.

param
locale locale name
return
new c collator
internal
ICU 2.4

static native intopenCollatorFromRules(java.lang.String rules, int normalizationmode, int collationstrength)
Method to create a new C Collator using the argument rules.

param
rules , set of collation rules
param
normalizationmode default normalization mode
param
collationstrength default collation strength
return
new c collator
internal
ICU 2.4

static native intprevious(int address)
Get the ordering priority of the previous collation element in the text. A single character may contain more than one collation element.

param
address of the C collation element iterator containing the text.
return
previous collation element ordering, or NULLORDER if the end of the text is reached.
internal
ICU 2.4

static native voidreset(int address)
Reset the collation elements to their initial state. This will move the 'cursor' to the beginning of the text.

param
address of C collation element iterator to reset.
internal
ICU 2.4

static native intsafeClone(int collatoraddress)
Thread safe cloning operation

param
collatoraddress address of C collator to be cloned
return
address of the new clone
exception
RuntimeException thrown when error occurs while cloning
internal
ICU 2.4

static native voidsetAttribute(int collatoraddress, int type, int value)
Universal attribute setter.

param
collatoraddress address of the C collator
param
type type of attribute to be set
param
value attribute value
exception
RuntimeException when error occurs while setting attribute value
internal
ICU 2.4

static native voidsetNormalization(int collatoraddress, int normalizationmode)
Set the normalization mode used int this object The normalization mode influences how strings are compared.

param
collatoraddress the address of the C collator
param
normalizationmode desired normalization mode; one of the values from Normalization
internal
ICU 2.4

static native voidsetOffset(int address, int offset)
Set the offset of the current source character. This is an offset into the text of the character to be processed.

param
address of the C collation element iterator to set.
param
offset The desired character offset.
internal
ICU 2.4

static native voidsetText(int address, java.lang.String source)
Set the text containing the collation elements.

param
address of the C collation element iterator to be set
param
source text containing the collation elements.
internal
ICU 2.4