Most visited

Recently visited

Added in API level 24

AlphabeticIndex.ImmutableIndex

public static final class AlphabeticIndex.ImmutableIndex
extends Object implements Iterable<Bucket<V>>

java.lang.Object
   ↳ android.icu.text.AlphabeticIndex.ImmutableIndex<V>


Immutable, thread-safe version of AlphabeticIndex. This class provides thread-safe methods for bucketing, and random access to buckets and their properties, but does not offer adding records to the index.

Summary

Public methods

Bucket<V> getBucket(int index)

Returns the index-th bucket.

int getBucketCount()

Returns the number of index buckets and labels, including underflow/inflow/overflow.

int getBucketIndex(CharSequence name)

Finds the index bucket for the given name and returns the number of that bucket.

Iterator<Bucket<V>> iterator()

Returns an iterator over elements of type T.

Inherited methods

From class java.lang.Object
From interface java.lang.Iterable

Public methods

getBucket

Added in API level 24
Bucket<V> getBucket (int index)

Returns the index-th bucket. Returns null if the index is out of range.

Parameters
index int: bucket number
Returns
Bucket<V> the index-th bucket

getBucketCount

Added in API level 24
int getBucketCount ()

Returns the number of index buckets and labels, including underflow/inflow/overflow.

Returns
int the number of index buckets

getBucketIndex

Added in API level 24
int getBucketIndex (CharSequence name)

Finds the index bucket for the given name and returns the number of that bucket. Use getBucket(int) to get the bucket's properties.

Parameters
name CharSequence: the string to be sorted into an index bucket
Returns
int the bucket number for the name

iterator

Added in API level 24
Iterator<Bucket<V>> iterator ()

Returns an iterator over elements of type T.

Returns
Iterator<Bucket<V>> an Iterator.

Hooray!