Class PictureStack

java.lang.Object
  extended by PictureStack

public class PictureStack
extends Object

Class that represents a stack of pictures

Author:
Mark Guzdial, Barb Ericson

Constructor Summary
PictureStack()
          Constructor
 
Method Summary
 boolean isEmpty()
          Method to return true if the stack is empty
 SceneElement peek()
          Method to return the top element, but not remove it from the stack
 SceneElement pop()
          Method to return the top element from the stack and remove it from the stack
 void push(SceneElement element)
          Method to add an element to the stack
 int size()
          Method to return the number of elements in the stack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PictureStack

public PictureStack()
Constructor

Method Detail

push

public void push(SceneElement element)
Method to add an element to the stack

Parameters:
element - the element to add

peek

public SceneElement peek()
Method to return the top element, but not remove it from the stack

Returns:
the top element

pop

public SceneElement pop()
Method to return the top element from the stack and remove it from the stack

Returns:
the top element

size

public int size()
Method to return the number of elements in the stack

Returns:
the number of elements in the stack

isEmpty

public boolean isEmpty()
Method to return true if the stack is empty

Returns:
true if the stack is empty else false