public class LinearContainer<T> extends Object implements Iterable<T>
Constructor and Description |
---|
LinearContainer(int n)
Creates a LinearContainer with the index range
[0, n - 1], like an ordinary array.
|
LinearContainer(int botIndex,
int topIndex)
Creates a LinearContainer with the index range
[botIndex, topIndex].
|
Modifier and Type | Method and Description |
---|---|
int |
getBotIndex() |
T |
getElement(int k) |
int |
getTopIndex() |
Iterator<T> |
iterator() |
void |
setElement(int k,
T elem) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public LinearContainer(int n)
n
- size of the container.public LinearContainer(int botIndex, int topIndex)
botIndex
- bottom (smallest) index.topIndex
- top (largest) index.public T getElement(int k)
public void setElement(int k, T elem)
public int getBotIndex()
public int getTopIndex()
Copyright © 2006–2017, Wilhelm Burger, Mark J. Burge (BSD 2-Clause Simplified License)