Package com.anylogic.engine
- Type Parameters:
E
- element type
- All Superinterfaces:
Iterable<T>
- All Known Implementing Classes:
AgentArrayList
,AgentLinkedHashSet
,AgentList
@AnyLogicInternalAPI public interface IterableWithSize<T> extends Iterable<T>
This interface is internal and shouldn't be called by user.
it may be removed/renamed in future.
Declares a collection with known size and ability to get element by index.
it may be removed/renamed in future.
Declares a collection with known size and ability to get element by index.
- Author:
- AnyLogic North America, LLC https://anylogic.com
Modifier and Type | Method | Description |
---|---|---|
T | get |
Returns the element at the specified position in this collection.
Depending on implementation, this method may have good or bad performance. |
boolean | isEmpty() |
Returns
true if this collection contains no elements. |
int | size() |
Returns the number of elements in this collection.
|
int size()
Returns the number of elements in this collection.
- Returns:
- the number of elements in this collection
boolean isEmpty()
Returns
true
if this collection contains no elements.- Returns:
true
if this collection contains no elements
T get(int index)
Returns the element at the specified position in this collection.
Depending on implementation, this method may have good or bad performance.
Depending on implementation, this method may have good or bad performance.
- Parameters:
index
- index of the element to return- Returns:
- the element at the specified position in this list
- Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()
)