|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Stack of Walks.
Method Summary | |
Walk |
getFromTop(int index)
Return the Walk at a given top relative index in the stack. |
int |
getSize()
Return the size of this stack. |
void |
insertFromTop(int index,
Walk walk)
Inserts a Walk in this stack at a top relative index. |
boolean |
isEmpty()
Returns true if this stack is empty. |
Walk |
pop()
Pops a Walk from this stack. |
void |
push(Walk walk)
Pushes a Walk on this stack. |
Walk |
removeFromTop(int index)
Removes and returns the Walk at a given top relative index in the stack. |
void |
returnToFactory()
Return this stack to the Factory. |
Walk |
top()
Returns the Walk at the top of this stack or null if it is empty. |
Method Detail |
public void returnToFactory()
Post-condition: this is no more usable.
public int getSize()
public boolean isEmpty()
public void push(Walk walk)
walk
- a Walk.
java.lang.IllegalArgumentException
- if the given Walk is null.public Walk pop()
java.lang.IllegalStateException
- if the stack is empty.public Walk top()
public Walk getFromTop(int index)
index
- an index in the stack, between 0 and size - 1.
java.lang.IndexOutOfBoundsException
- if index < 0 or index >= size.public void insertFromTop(int index, Walk walk)
index
- a top relative index.walk
- a Walk.
java.lang.IndexOutOfBoundsException
- if index < 0 or index >= size.public Walk removeFromTop(int index)
index
- a top relative index.
java.lang.IndexOutOfBoundsException
- if index < 0 or index >= size.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |