Package repast.simphony.util.collections
Interface IndexedIterable<T>
- All Superinterfaces:
Iterable<T>
- All Known Implementing Classes:
CompositeIndexedIterable
,ListIndexedIterable
An iterable that also provides indexed access to the underlying collection.
- Version:
- $Revision$ $Date$
- Author:
- Nick Collier
-
Method Summary
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
get
Gets the element at the specified position in this IndexedIterable. Note that this method is should be used for random access to the collection. iterator() is the preferred way to iterate through this IndexedIterable.- Parameters:
index
- the index of the element to return- Returns:
- the element at the specified position in this IndexedIterable.
- Throws:
IndexOutOfBoundsException
- if the given index is out of range (index < 0 || index >= size()).
-
size
int size()Gets the number of elements in this IndexedIterable.- Returns:
- the number of elements in this IndexedIterable.
-