public interface IndexedReadOnlyStringMap extends ReadOnlyStringMap
ReadOnlyStringMap
that imposes a total ordering on its keys.
The map is ordered according to the natural ordering of its keys. This order is reflected when
consuming
the key-value pairs with a BiConsumer
or a TriConsumer
.
This interface views all key-value pairs as a sequence ordered by key, and allows keys and values to be accessed by their index in the sequence.
ReadOnlyStringMap
Modifier and Type | Method and Description |
---|---|
String |
getKeyAt(int index)
Viewing all key-value pairs as a sequence sorted by key, this method returns the key at the specified index,
or
null if the specified index is less than zero or greater or equal to the size of this collection. |
<V> V |
getValueAt(int index)
Viewing all key-value pairs as a sequence sorted by key, this method returns the value at the specified index,
or
null if the specified index is less than zero or greater or equal to the size of this collection. |
int |
indexOfKey(String key)
Viewing all key-value pairs as a sequence sorted by key, this method returns the index of the specified key in
that sequence.
|
containsKey, forEach, forEach, getValue, isEmpty, size, toMap
String getKeyAt(int index)
null
if the specified index is less than zero or greater or equal to the size of this collection.index
- the index of the key to returnnull
<V> V getValueAt(int index)
null
if the specified index is less than zero or greater or equal to the size of this collection.index
- the index of the value to returnnull
int indexOfKey(String key)
(-(insertion point) - 1)
.key
- the key whose index in the ordered sequence of keys to return(-(insertion point) - 1)
if the key is not found.
The insertion point is defined as the point at which the key would be inserted into the array:
the index of the first element in the range greater than the key, or size()
if all elements
are less than the specified key. Note that this guarantees that the return value will be >= 0
if and only if the key is found.Copyright © 1999-1969 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.