cz.muni.fi.pb162.stackexample
Class NumberStack

java.lang.Object
  extended by cz.muni.fi.pb162.stackexample.NumberStack

public class NumberStack
extends java.lang.Object

This is a simple, example implementation of a stack that can store only integers. It supports only basic operations.

Version:
(a version number or a date)
Author:
Rastislav Mirek

Constructor Summary
NumberStack()
          Constructor for objects of class NumberStack Inicializes stack
 
Method Summary
 boolean isEmpty()
           
 java.lang.Integer pop()
          Deletes the top-most value from the stack.
 void push(int numberToStore)
          Stores given integer value on the top of the stack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberStack

public NumberStack()
Constructor for objects of class NumberStack Inicializes stack

Method Detail

isEmpty

public boolean isEmpty()
Returns:
true if the stack is empty, false otherwise

pop

public java.lang.Integer pop()
Deletes the top-most value from the stack. The value below it becames the next top-most value

Returns:
the top-most value of the stack that is to be removed or null if the stack is empty

push

public void push(int numberToStore)
Stores given integer value on the top of the stack

Parameters:
numberToStore - integer value to store in the stack