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>! |
Returns the index-th bucket. |
| Int |
Returns the number of index buckets and labels, including underflow/inflow/overflow. |
| Int |
getBucketIndex(name: CharSequence!)Finds the index bucket for the given name and returns the number of that bucket. |
| MutableIterator<AlphabeticIndex.Bucket<V>!> |
iterator()Returns an iterator over elements of type |
Public methods
getBucket
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
fun getBucketCount(): Int
Returns the number of index buckets and labels, including underflow/inflow/overflow.
| Return | |
|---|---|
Int |
the number of index buckets |
getBucketIndex
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
fun iterator(): MutableIterator<AlphabeticIndex.Bucket<V>!>
Returns an iterator over elements of type T.
| Return | |
|---|---|
MutableIterator<AlphabeticIndex.Bucket<V>!> |
an Iterator. |