de.hska.info1.adt
Class ListStack

java.lang.Object
  extended by de.hska.info1.adt.ListStack
All Implemented Interfaces:
Stack

public class ListStack
extends java.lang.Object
implements Stack

Implementiert Stack mit einer Liste. Das Ende der Liste ist das oberste Element.

Author:
pape

Field Summary
 
Fields inherited from interface de.hska.info1.adt.Stack
OBERE_GRENZE
 
Constructor Summary
ListStack()
           
ListStack(java.util.List stack)
           
 
Method Summary
 int pop()
          Entfernt die oberste Zahl vom Stack und gibt den Wert zurück.
 void push(int i)
          Schiebt die Zahl z oben auf den Stack.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListStack

public ListStack()

ListStack

public ListStack(java.util.List stack)
Method Detail

push

public void push(int i)
Description copied from interface: Stack
Schiebt die Zahl z oben auf den Stack. Wirft eine Exception, wenn der Stack schon voll ist.

Specified by:
push in interface Stack

pop

public int pop()
Description copied from interface: Stack
Entfernt die oberste Zahl vom Stack und gibt den Wert zurück. Wirft eine Exception, wenn der Stack leer ist.

Specified by:
pop in interface Stack


Prof. Dr. Pape