Package dsa.lab01.base
Interface StaticSequence<Item>
- Type Parameters:
Item
- the item type
- All Superinterfaces:
Container<Item>
A static sequence.
A container whose n
items are in an order given by their indices,
where the first item is at index 0, the second at index 1, and so on, the
n
th being at index n
-1.
-
Method Summary
-
Method Details
-
get
Get the item at the given index.- Parameters:
index
- the index- Returns:
- the item that is at that index
- Throws:
IndexOutOfBoundsException
- ifindex
< 0 orindex
>=n
(wheren
is the size)
-
set
Set the item at the given index.Replaces whatever item was there before.
- Parameters:
index
- the indexitem
- the new item that should now be at that index- Throws:
IndexOutOfBoundsException
- ifindex
< 0 orindex
>=n
(wheren
is the size)
-