ahc.collection
Interface Stack

All Known Implementing Classes:
GenericStack

public interface Stack

This interface represents a LIFO stack. It provides basically two operations, pushing a new object onto the stack and "popping" the topmost object from the stack.

Author:
Arno Haase

Method Summary
 void clear()
           
 boolean isEmpty()
           
 java.lang.Object peek()
           
 java.lang.Object peek(int n)
          takes a "peek" at one of the elements on the stack, counting from the top. peek(0) is the same as peek().
 java.lang.Object pop()
           
 java.lang.Object pop(int n)
          removes n items from the top of the stack and returns the last of them
 void push(java.lang.Object o)
           
 int size()
           
 

Method Detail

push

public void push(java.lang.Object o)

pop

public java.lang.Object pop()

peek

public java.lang.Object peek()

isEmpty

public boolean isEmpty()

size

public int size()

clear

public void clear()

pop

public java.lang.Object pop(int n)
removes n items from the top of the stack and returns the last of them


peek

public java.lang.Object peek(int n)
takes a "peek" at one of the elements on the stack, counting from the top. peek(0) is the same as peek().