iglu.util
Class Stack

java.lang.Object
  |
  +--iglu.util.Stack

public class Stack
extends java.lang.Object

A simple stack. Basically a few methods sitting on top of a LinkedList.

Author:
Travis Bauer

Field Summary
private  java.util.LinkedList data
           
 
Constructor Summary
Stack()
           
 
Method Summary
 java.lang.Object peek()
           
 java.lang.Object pop()
          Returns the top of the stack, and erases it.
 void push(java.lang.Object o)
          Adds an object on the stack.
 int size()
          How many objects are on the stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private java.util.LinkedList data
Constructor Detail

Stack

public Stack()
Method Detail

push

public void push(java.lang.Object o)
Adds an object on the stack.

Parameters:
o - an Object value

pop

public java.lang.Object pop()
Returns the top of the stack, and erases it.

Returns:
an Object value

peek

public java.lang.Object peek()

size

public int size()
How many objects are on the stack.

Returns:
an int value