org.ejtools.util
Class LimitedStack

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--java.util.Stack
                          |
                          +--org.ejtools.util.LimitedStack
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable
Direct Known Subclasses:
KeyLimitedStack

public class LimitedStack
extends java.util.Stack

Extension of the Stack class, which has a limited depth (FIFO stack). This class doesn't allow duplicates.

Version:
$Revision: 1.7 $
Author:
Laurent Etiemble
See Also:
Serialized Form

Field Summary
protected  int maximumSize
          Maximum number elements allowed in the stack
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
LimitedStack()
          Constructor for the LimitedStack object
LimitedStack(int size)
          Constructor for the LimitedStack object
 
Method Summary
 java.lang.Object push(java.lang.Object item)
          Overrides the push method to limit the number of elements.
 
Methods inherited from class java.util.Stack
empty, peek, pop, search
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

maximumSize

protected int maximumSize
Maximum number elements allowed in the stack

Constructor Detail

LimitedStack

public LimitedStack()
Constructor for the LimitedStack object


LimitedStack

public LimitedStack(int size)
Constructor for the LimitedStack object

Parameters:
size - Depth size of the stack
Method Detail

push

public java.lang.Object push(java.lang.Object item)
Overrides the push method to limit the number of elements.

Overrides:
push in class java.util.Stack
Parameters:
item - Item to push onto the stack
Returns:
The item pushed


Copyright © 2002-2003 EJTools Org.. All Rights Reserved.