ealet
Class LongStack

java.lang.Object
  extended by ealet.LongStack

public class LongStack
extends java.lang.Object

A stack algorithm implementation based on long data type.

Version:
1.00 October 12, 2005
Author:
abass alamnehe

Constructor Summary
LongStack()
          Creates a new instance of Stack
LongStack(int size)
          Creates a new instance of Stack with new length
 
Method Summary
 long get(int index)
          Returns indexed value from the stack
 int getTop()
          Returns the top position of the stack
 boolean isEmpty()
          Returns true if the stack is empty, or false if it is not
 boolean isFull()
          Returns true if the stack is full, or false if it is not
 long peek()
          Allows Peeking into the stack by showing the top most of element
 long pop()
          Pops is the top value if the stack is not empty
 void push(long value)
          Pushes a new value if the stack is not full
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongStack

public LongStack()
Creates a new instance of Stack


LongStack

public LongStack(int size)
Creates a new instance of Stack with new length

Method Detail

isFull

public boolean isFull()
Returns true if the stack is full, or false if it is not


isEmpty

public boolean isEmpty()
Returns true if the stack is empty, or false if it is not


push

public void push(long value)
Pushes a new value if the stack is not full


pop

public long pop()
Pops is the top value if the stack is not empty


getTop

public int getTop()
Returns the top position of the stack


get

public long get(int index)
Returns indexed value from the stack


peek

public long peek()
Allows Peeking into the stack by showing the top most of element