de.hska.info1.adt
Class Stack1

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

public class Stack1
extends java.lang.Object
implements Stack

Implementiert einen Stack mit einem Feld, wobei der Stack von "unten" nach "oben" wächst. D.h., das unterste Element hat den Indexwert 0.

Author:
pape

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

Constructor Detail

Stack1

public Stack1()
Method Detail

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

push

public void push(int z)
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

size

public int size()


Prof. Dr. Pape