Package com.adobe.internal.util
Interface Stack<T>
- All Known Implementing Classes:
ArrayListStack
public interface Stack<T>
-
Method Summary
-
Method Details
-
push
Adds an item to the top of the stack.- Parameters:
x
- the item to add.- Returns:
- the item added.
-
pop
T pop()Removes and returns item from the top of the stack.- Returns:
- the former top item.
- Throws:
EmptyStackException
- if stack is empty.
-
peek
T peek()Returns item from the top of the stack.- Returns:
- the top item.
- Throws:
EmptyStackException
- if stack is empty.
-
empty
boolean empty()Tests if stack is empty.- Returns:
- true if the stack is empty; false otherwise.
-
size
int size()Returns the size of the stack.- Returns:
- the size of the stack.
-
clear
void clear()
-