Methods Summary |
---|
public boolean | empty()Tests if this stack is empty.
return (stack.size() == 0);
|
public boolean | isEmpty()Tests if this stack is empty.
return (stack.size() == 0);
|
public java.lang.Object | peek()Looks at the object at the top of this stack without removing it from the stack.
if (stack.size() == 0)
throw new java.util.EmptyStackException();
return stack.get(stack.size()-1);
|
public java.lang.Object | pop()Pops the object that is at the top of this stack.
if (stack.size() == 0)
throw new java.util.EmptyStackException();
return stack.remove(stack.size()-1);
|
public void | push(java.lang.Object object)Pushes the object at the top of this stack.
stack.add(object);
|
public int | size()Gets the current size of the stack.
return stack.size();
|