/** * Adds the index characters in the range between the specified start and * end code points, inclusive. */ public synchronized AlphabeticIndex addLabelRange(int codePointStart, int codePointEnd) { addLabelRange(peer, codePointStart, codePointEnd); return this; }
/** * Adds the index characters from the given locale to the index. * The labels are added to those that are already in the index; * they do not replace the existing index characters. * The collation order for this index is not changed; * it remains that of the locale that was originally specified * when creating this index. */ public synchronized AlphabeticIndex addLabels(Locale locale) { addLabels(peer, locale.toString()); return this; }
/** * Returns an ImmutableIndex created from this AlphabeticIndex. */ public synchronized ImmutableIndex getImmutableIndex() { return new ImmutableIndex(buildImmutableIndex(peer)); }
/** * Sets the max number of the label buckets in this index. * (ICU 51 default is 99) */ public synchronized AlphabeticIndex setMaxLabelCount(int count) { setMaxLabelCount(peer, count); return this; }
/** * Creates a new AlphabeticIndex for the given locale. */ public AlphabeticIndex(Locale locale) { peer = create(locale.toString()); }
/** * Returns the label for the bucket at the given index (as returned by getBucketIndex). */ public synchronized String getBucketLabel(int index) { return getBucketLabel(peer, index); }
@Override protected synchronized void finalize() throws Throwable { try { destroy(peer); peer = 0; } finally { super.finalize(); } }
/** * Returns the max number of the label buckets allowed in this index. */ public synchronized int getMaxLabelCount() { return getMaxLabelCount(peer); }
/** * Returns the number of the label buckets in this index. */ public synchronized int getBucketCount() { return getBucketCount(peer); }
/** * Returns the index of the bucket in which 's' should appear. * Function is synchronized because underlying routine walks an iterator * whose state is maintained inside the index object. */ public synchronized int getBucketIndex(String s) { return getBucketIndex(peer, s); }
/** * Sets the max number of the label buckets in this index. * (ICU 51 default is 99) */ public synchronized AlphabeticIndex setMaxLabelCount(int count) { setMaxLabelCount(peer, count); return this; }
/** * Creates a new AlphabeticIndex for the given locale. */ public AlphabeticIndex(Locale locale) { peer = create(locale.toString()); }
/** * Returns the label for the bucket at the given index (as returned by getBucketIndex). */ public synchronized String getBucketLabel(int index) { return getBucketLabel(peer, index); }
@Override protected synchronized void finalize() throws Throwable { try { destroy(peer); peer = 0; } finally { super.finalize(); } }
/** * Returns the max number of the label buckets allowed in this index. */ public synchronized int getMaxLabelCount() { return getMaxLabelCount(peer); }
/** * Returns the number of the label buckets in this index. */ public synchronized int getBucketCount() { return getBucketCount(peer); }
/** * Returns the index of the bucket in which 's' should appear. * Function is synchronized because underlying routine walks an iterator * whose state is maintained inside the index object. */ public synchronized int getBucketIndex(String s) { return getBucketIndex(peer, s); }
/** * Adds the index characters in the range between the specified start and * end code points, inclusive. */ public synchronized AlphabeticIndex addLabelRange(int codePointStart, int codePointEnd) { addLabelRange(peer, codePointStart, codePointEnd); return this; }
/** * Sets the max number of the label buckets in this index. * (ICU 51 default is 99) */ public synchronized AlphabeticIndex setMaxLabelCount(int count) { setMaxLabelCount(peer, count); return this; }
/** * Creates a new AlphabeticIndex for the given locale. */ public AlphabeticIndex(Locale locale) { peer = create(locale.toString()); }