Package com.ibm.icu.text
Class AlphabeticIndex.ImmutableIndex<V>
java.lang.Object
com.ibm.icu.text.AlphabeticIndex.ImmutableIndex<V>
- Type Parameters:
V
- The Record value type is unused. It can be omitted for this class if it was omitted for the AlphabeticIndex that built it.
- All Implemented Interfaces:
Iterable<AlphabeticIndex.Bucket<V>>
- Enclosing class:
AlphabeticIndex<V>
public static final class AlphabeticIndex.ImmutableIndex<V>
extends Object
implements Iterable<AlphabeticIndex.Bucket<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.-
Method Summary
Modifier and TypeMethodDescriptiongetBucket
(int index) Returns the index-th bucket.int
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()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getBucketCount
public int getBucketCount()Returns the number of index buckets and labels, including underflow/inflow/overflow.- Returns:
- the number of index buckets
-
getBucketIndex
Finds the index bucket for the given name and returns the number of that bucket. UsegetBucket(int)
to get the bucket's properties.- Parameters:
name
- the string to be sorted into an index bucket- Returns:
- the bucket number for the name
-
getBucket
Returns the index-th bucket. Returns null if the index is out of range.- Parameters:
index
- bucket number- Returns:
- the index-th bucket
-
iterator
-