Added in API level 24

ImmutableIndex


class ImmutableIndex<V : Any!> : MutableIterable<AlphabeticIndex.Bucket<V>!>
kotlin.Any
   ↳ android.icu.text.AlphabeticIndex.ImmutableIndex

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
AlphabeticIndex.Bucket<V>!
getBucket(index: Int)

Returns the index-th bucket.

Int

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

Int

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

MutableIterator<AlphabeticIndex.Bucket<V>!>

Returns an iterator over elements of type T.

Public methods

getBucket

Added in API level 24
fun getBucket(index: Int): AlphabeticIndex.Bucket<V>!

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

Parameters
index Int: bucket number
Return
AlphabeticIndex.Bucket<V>! the index-th bucket

getBucketCount

Added in API level 24
fun getBucketCount(): Int

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

Return
Int the number of index buckets

getBucketIndex

Added in API level 24
fun getBucketIndex(name: CharSequence!): Int

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
Return
Int the bucket number for the name

iterator

Added in API level 24
fun iterator(): MutableIterator<AlphabeticIndex.Bucket<V>!>

Returns an iterator over elements of type T.

Return
MutableIterator<AlphabeticIndex.Bucket<V>!> an Iterator.