Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jfree.data
Interface KeyedValues

All Superinterfaces:
  Values

All Known Subinterfaces:
  KeyedValuesDataset, PieDataset

All Known Implementing Classes:
  CategoryToPieDataset, DefaultKeyedValues, DefaultKeyedValuesDataset, DefaultPieDataset

public interface KeyedValues
extends Values

A collection of values where each value is associated with a key.

See Also:
  `Values`, `DefaultKeyedValues`

Method Summary
`int` | `getIndex(java.lang.Comparable key)` Returns the index for a given key.
`java.lang.Comparable` | `getKey(int index)` Returns the key associated with an item (value).
`java.util.List` | `getKeys()` Returns the keys for the values in the collection.
`java.lang.Number` | `getValue(java.lang.Comparable key)` Returns the value (possibly `null`) for a given key.

Methods inherited from interface org.jfree.data.Values
`getItemCount, getValue`

Method Detail

### getKey

    public java.lang.Comparable getKey(int index)

  Returns the key associated with an item (value).

  Parameters:
    `index` - the item index (zero-based).
  Returns:
    the key.

### getIndex

    public int getIndex(java.lang.Comparable key)

  Returns the index for a given key.

  Parameters:
    `key` - the key.
  Returns:
    the index (-1 indicates that the key is not in the collection).

### getKeys

    public java.util.List getKeys()

  Returns the keys for the values in the collection. Note that you can access the values in this collection by key or by index. For this reason, the key order is important - this method should return the keys in order.

  Returns:
    The keys (never `null`).

### getValue

    public java.lang.Number getValue(java.lang.Comparable key)

  Returns the value (possibly `null`) for a given key.

  If the key is not recognised, the method should return `null`.

  Parameters:
    `key` - the key.
  Returns:
    the value.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD