public interface KeyedValues extends Values
null
.Values
,
DefaultKeyedValues
Modifier and Type | Method and Description |
---|---|
int |
getIndex(java.lang.Comparable key)
Returns the index for a given key.
|
java.lang.Comparable |
getKey(int index)
Returns the key associated with the item at a given position.
|
java.util.List |
getKeys()
Returns the keys for the values in the collection.
|
java.lang.Number |
getValue(java.lang.Comparable key)
Returns the value for a given key.
|
getItemCount, getValue
java.lang.Comparable getKey(int index)
index
- the item index (in the range 0
to
getItemCount() - 1
).null
).java.lang.IndexOutOfBoundsException
- if index
is not in the
specified range.int getIndex(java.lang.Comparable key)
key
- the key (null
not permitted).-1
if the key is unrecognised.java.lang.IllegalArgumentException
- if key
is
null
.java.util.List getKeys()
null
).java.lang.Number getValue(java.lang.Comparable key)
key
- the key.null
).UnknownKeyException
- if the key is not recognised.