gnu.trove
public class TIntStack extends Object
Version: $Id: TIntStack.java,v 1.1 2002/01/01 18:51:23 ericdf Exp $
| Field Summary | |
|---|---|
| static int | DEFAULT_CAPACITY |
| protected TIntArrayList | _list the list used to hold the stack values. |
| Constructor Summary | |
|---|---|
| TIntStack()
Creates a new TIntStack instance with the default
capacity. | |
| TIntStack(int capacity)
Creates a new TIntStack instance with the
specified capacity.
| |
| Method Summary | |
|---|---|
| void | clear()
Clears the stack, reseting its capacity to the default. |
| int | peek()
Returns the value at the top of the stack.
|
| int | pop()
Removes and returns the value at the top of the stack.
|
| void | push(int val)
Pushes the value onto the top of the stack.
|
| void | reset()
Clears the stack without releasing its internal capacity allocation. |
| int | size()
Returns the current depth of the stack.
|
TIntStack instance with the default
capacity.TIntStack instance with the
specified capacity.
Parameters: capacity the initial depth of the stack
Returns: an int value
Returns: an int value
Parameters: val an int value
Returns: an int value