public class IntStack extends IntVector
m_blocksize, m_firstFree, m_map, m_mapSize
Constructor and Description |
---|
IntStack()
Default constructor.
|
IntStack(int blocksize)
Construct a IntVector, using the given block size.
|
IntStack(IntStack v)
Copy constructor for IntStack
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns clone of current IntStack
|
boolean |
empty()
Tests if this stack is empty.
|
int |
peek()
Looks at the object at the top of this stack without removing it
from the stack.
|
int |
peek(int n)
Looks at the object at the position the stack counting down n items.
|
int |
pop()
Removes the object at the top of this stack and returns that
object as the value of this function.
|
int |
push(int i)
Pushes an item onto the top of this stack.
|
void |
quickPop(int n)
Quickly pops a number of items from the stack.
|
int |
search(int o)
Returns where an object is on this stack.
|
void |
setTop(int val)
Sets an object at a the top of the statck
|
addElement, addElements, addElements, contains, elementAt, indexOf, indexOf, insertElementAt, lastIndexOf, removeAllElements, removeElement, removeElementAt, setElementAt, setSize, size
public IntStack()
public IntStack(int blocksize)
blocksize
- Size of block to allocatepublic IntStack(IntStack v)
v
- IntStack to copypublic int push(int i)
i
- the int to be pushed onto this stack.item
argument.public final int pop()
public final void quickPop(int n)
public final int peek()
EmptyStackException
- if this stack is empty.public int peek(int n)
n
- The number of items down, indexed from zero.EmptyStackException
- if this stack is empty.public void setTop(int val)
val
- object to set at the topEmptyStackException
- if this stack is empty.public boolean empty()
true
if this stack is empty;
false
otherwise.public int search(int o)
o
- the desired object.-1
indicates that the
object is not on the stack.public Object clone() throws CloneNotSupportedException
clone
in class IntVector
CloneNotSupportedException
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.