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

## sim.util
Interface Indexed

All Known Implementing Classes:
  Bag, DoubleBag, 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
`java.lang.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()
`java.lang.Object` | `getValue(int index)` Throws an IndexOutOfBoundsException if index is inappropriate.
`java.lang.Object` | `setValue(int index, java.lang.Object value)` Throws an IndexOutOfBoundsException if index is inappropriate, and IllegalArgumentException if the value is inappropriate.
`int` | `size()`

Method Detail

### componentType

    java.lang.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

    java.lang.Object setValue(int index,
                              java.lang.Object value)
                              throws java.lang.IndexOutOfBoundsException,
                                     java.lang.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:
    `java.lang.IndexOutOfBoundsException`
    `java.lang.IllegalArgumentException`

### getValue

    java.lang.Object getValue(int index)
                              throws java.lang.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:
    `java.lang.IndexOutOfBoundsException`

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