public final class FastIntStack extends Object
Unsynchronized stack optimized for long primitive type. Is significantly faster than a normal Stack.
| Constructor and Description |
|---|
FastIntStack()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Reset the stack.
|
int |
get(int position)
Get element at given position in stack.
|
int |
peek()
Get the element on top of the stack.
|
int |
pop()
Remove topmost element from stack.
|
void |
push(int element)
Place new element on top of stack.
|
int |
size()
Get the current stackSize of the stack.
|
public void push(int element)
element - Element to push.public int peek()
public int get(int position)
position - Position in stack from where to get the element.public int pop()
public void clear()
public int size()
Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.