FileDocCategorySizeDatePackage
MyStack.javaAPI DocExample494Sun Mar 07 17:19:00 GMT 2004None

MyStack

public class MyStack extends Object
A lax Stack implementation.
version
$Id: MyStack.java,v 1.4 2004/03/07 23:18:59 ian Exp $

Fields Summary
private int
ix
public static final int
MAX
private T[]
data
Constructors Summary
Methods Summary
public booleanhasNext()

		return ix > 0;
	
public booleanhasRoom()

		return ix < MAX;
	
public Tpop()

		if (hasNext()) {
			return data[--ix];
		}
		throw new ArrayIndexOutOfBoundsException(-1);
	
public voidpush(T obj)


	    
		data[ix++] = obj;