|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectit.unimi.dsi.fastutil.AbstractStack<K>
public abstract class AbstractStack<K>
An abstract class providing basic methods for implementing the Stack interface.
This class just defines Stack.top() as peek(0), and
Stack.peek(int) as throwing an UnsupportedOperationException.
Subclasses of this class may choose to implement just Stack.push(Object),
Stack.pop() and Stack.isEmpty(), or (but this is not
required) go farther and implement Stack.top(), or even Stack.peek(int).
| Constructor Summary | |
|---|---|
AbstractStack()
|
|
| Method Summary | |
|---|---|
K |
peek(int i)
Peeks at an element on the stack (optional operation). |
K |
top()
Peeks at the top of the stack (optional operation). |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface it.unimi.dsi.fastutil.Stack |
|---|
isEmpty, pop, push |
| Constructor Detail |
|---|
public AbstractStack()
| Method Detail |
|---|
public K top()
Stack
top in interface Stack<K>public K peek(int i)
Stack
peek in interface Stack<K>i-th element on the stack; 0 represents the top.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||