Package ec.util

# Interface Indexed

All Known Implementing Classes:
  `IntBag`

public interface Indexed
A simple interface (simpler than List) for accessing random-access objects without changing their size. Adhered to by Bag, IntBag, and DoubleBag

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Class`
  `componentType()`
  Should return the base component type for this Indexed object, or null if the component type should be queried via getValue(index).getClass.getComponentType()
  `Object`
  `getValue(int index)`
  Throws an IndexOutOfBoundsException if index is inappropriate.
  `Object`
  `setValue(int index, Object value)`
  Throws an IndexOutOfBoundsException if index is inappropriate, and IllegalArgumentException if the value is inappropriate.
  `int`
  `size()`

- ## Method Details

  - ### componentType

    Class componentType()
    Should return the base component type for this Indexed object, or null if the component type should be queried via getValue(index).getClass.getComponentType()

  - ### size

    int size()

  - ### setValue

    Object setValue(int index, Object value) throws IndexOutOfBoundsException, IllegalArgumentException
    Throws an IndexOutOfBoundsException if index is inappropriate, and IllegalArgumentException if the value is inappropriate. Not called set() in order to be consistent with getValue(...)
    Throws:
      `IndexOutOfBoundsException`
      `IllegalArgumentException`

  - ### getValue

    Object getValue(int index) throws IndexOutOfBoundsException
    Throws an IndexOutOfBoundsException if index is inappropriate. Not called get() because this would conflict with get() methods in IntBag etc. which don't return objects.
    Throws:
      `IndexOutOfBoundsException`