|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.collections.primitives.IntStack
public class IntStack
A primitive int based Stack.
Constructor Summary | |
---|---|
IntStack()
|
|
IntStack(int[] numbas)
|
Method Summary | |
---|---|
void |
clear()
Empties the contents of the stack. |
boolean |
empty()
Tests if this stack is empty. |
int |
get(int index)
Gets items from the stack where the index is zero based and the top of the stack is at an index of size()-1 with the bottom of the stack at an index of 0. |
int |
peek()
Looks at the int at the top of this stack without removing it from the stack. |
int |
peek(int n)
Return the n'th int down the stack, where 0 is the top element and [size()-1] is the bottom element. |
int |
pop()
Removes the int at the top of this stack and returns that object as the value of this function. |
int |
push(int item)
Pushes an int item onto the top of this stack. |
int |
search(int item)
Returns the 1-based position where an int is on this stack. |
int |
size()
Gets the size of this stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IntStack()
public IntStack(int[] numbas)
Method Detail |
---|
public boolean empty()
public int peek()
EmptyStackException
- if this stack is emptypublic int peek(int n)
n
- the element index
EmptyStackException
- if the stack is empty
IndexOutOfBoundsException
- if the index is out of boundspublic int pop()
EmptyStackException
- if this stack is emptypublic int push(int item)
item
- the int item to push onto this stack
public int search(int item)
item
- the int to search for from the top down
public int get(int index)
index
- the index into the stack treated as a list
public int size()
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |