FileDocCategorySizeDatePackage
Stack.javaAPI DocExample1414Mon Aug 28 18:45:34 BST 2000com.imaginary.util

Stack

public interface Stack
A generic interface for stacked collections. This interface prescribes methods that let you access objects in a collection based on some rule of order.
Last modified $Date: 1999/11/06 18:38:04 $
version
$Revision: 1.1.1.1 $
author
George Reese (borg@imaginary.com)

Fields Summary
Constructors Summary
Methods Summary
public booleanisEmpty()

return
true if there are no objects on the stack

public java.lang.Objectpeek()
Provides a look at the next object on the stack without removing it.

return
the next object on the stack

public java.lang.Objectpop()
Removes the next object on the stack and returns it.

return
the next object on the stack

public java.lang.Objectpush(java.lang.Object ob)
Places an object on the stack.

param
ob the object to be placed on the stack
return
the object placed on the stack

public intsearch(java.lang.Object ob)
Provides the location of the specified object on the stack. The number 1 means the first object, 2 the second, and so on.

return
the location of the object on the stack or -1 if it is not on the stack

public intsize()

return
the number of objects on the stack.