baseCode.dataStructure
Class Stack

java.lang.Object
  extended bybaseCode.dataStructure.Stack

Deprecated. -- use java.util.List instead.

public class Stack
extends java.lang.Object

Simple Stack implementation

Copyright (c) 2004

Institution: Columbia University

Version:
$Id: Stack.java,v 1.5 2004/07/29 08:38:49 pavlidis Exp $
Author:
Paul Pavlidis

Constructor Summary
Stack()
          Deprecated. Build a stack with the default capacity.
Stack(int capacity)
          Deprecated. Build a stack with a given capacity.
 
Method Summary
 boolean isEmpty()
          Deprecated.  
 boolean isFull()
          Deprecated.  
 java.lang.Object pop()
          Deprecated. Remove the most recently added item.
 void push(java.lang.Object obj)
          Deprecated. Add an item to the stack.
 java.lang.Object top()
          Deprecated. Get the most recently added item, without removing it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stack

public Stack()
Deprecated. 
Build a stack with the default capacity.


Stack

public Stack(int capacity)
Deprecated. 
Build a stack with a given capacity.

Parameters:
capacity - int
Method Detail

pop

public java.lang.Object pop()
Deprecated. 
Remove the most recently added item.

Returns:
Object

push

public void push(java.lang.Object obj)
Deprecated. 
Add an item to the stack.

Parameters:
obj - Object

top

public java.lang.Object top()
Deprecated. 
Get the most recently added item, without removing it.

Returns:
Object

isEmpty

public boolean isEmpty()
Deprecated. 
Returns:
boolean

isFull

public boolean isFull()
Deprecated. 
Returns:
boolean


Copyright © 2003-2005 Columbia University. All Rights Reserved.