org.ejtools.util
Class KeyLimitedStack

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

public class KeyLimitedStack
extends LimitedStack

Extension of the Limited Stack class, which doesn't allow duplicates.

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

Field Summary
 
Fields inherited from class org.ejtools.util.LimitedStack
maximumSize
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
KeyLimitedStack()
          Constructor for KeyLimitedStack.
KeyLimitedStack(int size)
          Constructor for KeyLimitedStack.
 
Method Summary
 java.lang.Object push(java.lang.Object item)
          Overrides the push method to limit the number of elements and skip duplicates.
 
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
 

Constructor Detail

KeyLimitedStack

public KeyLimitedStack()
Constructor for KeyLimitedStack.


KeyLimitedStack

public KeyLimitedStack(int size)
Constructor for KeyLimitedStack.

Parameters:
size -
Method Detail

push

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

Overrides:
push in class LimitedStack
Parameters:
item - Item to push onto the stack
Returns:
The item pushed


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