ahc.collection
Class GenericStack

java.lang.Object
  |
  +--ahc.collection.GenericStack
All Implemented Interfaces:
Stack

public class GenericStack
extends java.lang.Object
implements Stack

This is the generic, configurable implementation of a Stack.

Author:
Arno Haase

Constructor Summary
GenericStack()
           
GenericStack(int initialSize)
           
GenericStack(Store store, AccessStrategy accessStrategy)
           
 
Method Summary
 void clear()
           
 boolean isEmpty()
           
 java.lang.Object peek()
           
 java.lang.Object peek(int n)
          takes a "peek" at one of the elements on the stack, counting from the top. peek(0) is the same as peek().
 java.lang.Object pop()
           
 java.lang.Object pop(int n)
          removes n items from the top of the stack and returns the last of them
 void push(java.lang.Object o)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericStack

public GenericStack(Store store,
                    AccessStrategy accessStrategy)

GenericStack

public GenericStack(int initialSize)

GenericStack

public GenericStack()
Method Detail

push

public void push(java.lang.Object o)
Specified by:
push in interface Stack

pop

public java.lang.Object pop()
Specified by:
pop in interface Stack

peek

public java.lang.Object peek()
Specified by:
peek in interface Stack

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Stack

size

public int size()
Specified by:
size in interface Stack

clear

public void clear()
Specified by:
clear in interface Stack

pop

public java.lang.Object pop(int n)
Description copied from interface: Stack
removes n items from the top of the stack and returns the last of them

Specified by:
pop in interface Stack

peek

public java.lang.Object peek(int n)
Description copied from interface: Stack
takes a "peek" at one of the elements on the stack, counting from the top. peek(0) is the same as peek().

Specified by:
peek in interface Stack