public class ArrayPureStack<E> extends java.lang.Object implements PureStack<E>
| Constructor and Description |
|---|
ArrayPureStack()
Initializes this ArrayPureStack object to be empty, with an initial
capacity of 10.
|
ArrayPureStack(ArrayPureStack<E> otherStack)
Initializes this ArrayPureStack object to contain a shallow copy of
another ArrayPureStack object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isEmpty()
Determines if this ArrayPureStack object has no elements.
|
static void |
main(java.lang.String[] arg)
Test program for ArrayPureStack
|
E |
peek()
Returns the top element on this ArrayPureStack object.
|
E |
pop()
Removes the top element from this ArrayPureStack object.
|
void |
push(E element)
Inserts a specified element on the top of this ArrayPureStack object.
|
int |
size()
Determines the number of elements in this ArrayPureStack object.
|
java.lang.String |
toString()
Returns a string representing the stack
|
public ArrayPureStack()
public ArrayPureStack(ArrayPureStack<E> otherStack)
otherStack - - the ArrayPureStack object to be copied to
this ArrayPureStack object.public int size()
public boolean isEmpty()
public E pop()
public E peek()
public void push(E element)
public java.lang.String toString()
toString in class java.lang.Objectpublic static void main(java.lang.String[] arg)
arg - the command line parameters - not used in this program