All Packages Class Hierarchy This Package Previous Next Index
Class flybase.FastStack
java.lang.Object
|
+----flybase.FastVector
|
+----flybase.FastStack
- public class FastStack
- extends flybase.FastVector
A Last-In-First-Out(LIFO) stack of objects.
-
FastStack()
-
-
empty()
- Returns true if the stack is empty.
-
peek()
- Peeks at the top of the stack.
-
pop()
- Pops an item off the stack.
-
push(Object)
- Pushes an item onto the stack.
-
search(Object)
- Sees if an object is on the stack.
FastStack
public FastStack()
push
public java.lang.Object push(java.lang.Object item)
- Pushes an item onto the stack.
- Parameters:
- item - the item to be pushed on.
pop
public java.lang.Object pop()
- Pops an item off the stack.
- Throws: EmptyStackException
- If the stack is empty.
peek
public java.lang.Object peek()
- Peeks at the top of the stack.
- Throws: EmptyStackException
- If the stack is empty.
empty
public boolean empty()
- Returns true if the stack is empty.
search
public int search(java.lang.Object o)
- Sees if an object is on the stack.
- Parameters:
- o - the desired object
- Returns:
- the distance from the top, or -1 if it is not found.
All Packages Class Hierarchy This Package Previous Next Index