@Override protected void finalize() throws Throwable { try { NativeCollation.closeCollator(address); } finally { super.finalize(); } } }
/** * Garbage collection. * Close C collator and reclaim memory. * @stable ICU 2.4 */ @Override protected void finalize() throws Throwable { try { NativeCollation.closeElements(address); } finally { super.finalize(); } }
public int compare(String source, String target) { return NativeCollation.compare(address, source, target); }
public int getStrength() { return NativeCollation.getAttribute(address, STRENGTH); }
/** * Get the maximum length of any expansion sequences that end with the * specified comparison order. * @param order collation order returned by previous or next. * @return maximum size of the expansion sequences ending with the collation * element or 1 if collation element does not occur at the end of * any expansion sequence * @stable ICU 2.4 */ public int getMaxExpansion(int order) { return NativeCollation.getMaxExpansion(address, order); }
/** * Get the offset of the current source character. * This is an offset into the text of the character containing the current * collation elements. * @return offset of the current source character. * @stable ICU 2.4 */ public int getOffset() { return NativeCollation.getOffset(address); }
/** * Get the ordering priority of the next collation element in the text. * A single character may contain more than one collation element. * @return next collation elements ordering, or NULLORDER if the end of the * text is reached. * @stable ICU 2.4 */ public int next() { return NativeCollation.next(address); }
public CollationKey getCollationKey(String source) { if (source == null) { return null; } byte[] key = NativeCollation.getSortKey(address, source); if (key == null) { return null; } return new CollationKeyICU(source, key); }
public static CollationElementIteratorICU getInstance(long collatorAddress, String source) { long iteratorAddress = NativeCollation.getCollationElementIterator(collatorAddress, source); return new CollationElementIteratorICU(iteratorAddress); }
public String getRules() { return NativeCollation.getRules(address); }
public int getDecomposition() { return NativeCollation.getAttribute(address, DECOMPOSITION_MODE); }
/** * Get the maximum length of any expansion sequences that end with the * specified comparison order. * @param order collation order returned by previous or next. * @return maximum size of the expansion sequences ending with the collation * element or 1 if collation element does not occur at the end of * any expansion sequence * @stable ICU 2.4 */ public int getMaxExpansion(int order) { return NativeCollation.getMaxExpansion(address, order); }
/** * Get the offset of the current source character. * This is an offset into the text of the character containing the current * collation elements. * @return offset of the current source character. * @stable ICU 2.4 */ public int getOffset() { return NativeCollation.getOffset(address); }
/** * Get the ordering priority of the next collation element in the text. * A single character may contain more than one collation element. * @return next collation elements ordering, or NULLORDER if the end of the * text is reached. * @stable ICU 2.4 */ public int next() { return NativeCollation.next(address); }
public CollationKey getCollationKey(String source) { if (source == null) { return null; } byte[] key = NativeCollation.getSortKey(address, source); if (key == null) { return null; } return new CollationKeyICU(source, key); }
public static CollationElementIteratorICU getInstance(long collatorAddress, String source) { long iteratorAddress = NativeCollation.getCollationElementIterator(collatorAddress, source); return new CollationElementIteratorICU(iteratorAddress); }
public String getRules() { return NativeCollation.getRules(address); }
public int getAttribute(int type) { return NativeCollation.getAttribute(address, type); }
/** * Get the maximum length of any expansion sequences that end with the * specified comparison order. * @param order collation order returned by previous or next. * @return maximum size of the expansion sequences ending with the collation * element or 1 if collation element does not occur at the end of * any expansion sequence * @stable ICU 2.4 */ public int getMaxExpansion(int order) { return NativeCollation.getMaxExpansion(address, order); }
/** * Garbage collection. * Close C collator and reclaim memory. * @stable ICU 2.4 */ @Override protected void finalize() throws Throwable { try { NativeCollation.closeElements(address); } finally { super.finalize(); } }