java.lang.Cloneable
public class ObjectStack extends ObjectVector
Constructor | Description |
---|---|
ObjectStack() |
Default constructor.
|
ObjectStack(int blocksize) |
Construct a ObjectVector, using the given block size.
|
ObjectStack(ObjectStack v) |
Copy constructor for ObjectStack
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
clone() |
Returns clone of current ObjectStack
|
boolean |
empty() |
Tests if this stack is empty.
|
java.lang.Object |
peek() |
Looks at the object at the top of this stack without removing it
from the stack.
|
java.lang.Object |
peek(int n) |
Looks at the object at the position the stack counting down n items.
|
java.lang.Object |
pop() |
Removes the object at the top of this stack and returns that
object as the value of this function.
|
java.lang.Object |
push(java.lang.Object 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(java.lang.Object o) |
Returns where an object is on this stack.
|
void |
setTop(java.lang.Object val) |
Sets an object at a the top of the statck
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addElement, addElements, addElements, contains, elementAt, indexOf, indexOf, insertElementAt, lastIndexOf, removeAllElements, removeElement, removeElementAt, setElementAt, setSize, setToSize, size
public ObjectStack()
public ObjectStack(int blocksize)
blocksize
- Size of block to allocatepublic ObjectStack(ObjectStack v)
v
- ObjectStack to copypublic java.lang.Object push(java.lang.Object i)
i
- the int to be pushed onto this stack.item
argument.public java.lang.Object pop()
public void quickPop(int n)
public java.lang.Object peek()
java.util.EmptyStackException
- if this stack is empty.public java.lang.Object peek(int n)
n
- The number of items down, indexed from zero.java.util.EmptyStackException
- if this stack is empty.public void setTop(java.lang.Object val)
val
- object to set at the topjava.util.EmptyStackException
- if this stack is empty.public boolean empty()
true
if this stack is empty;
false
otherwise.public int search(java.lang.Object o)
o
- the desired object.-1
indicates that the
object is not on the stack.public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class ObjectVector
java.lang.CloneNotSupportedException
Copyright © 2014 Apache XML Project. All Rights Reserved.