Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.rgw.tools
Class LimitSizeStack<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList<T>
                  extended by ch.rgw.tools.LimitSizeStack<T>
Type Parameters:
T -
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.Deque<T>, java.util.List<T>, java.util.Queue<T>

public class LimitSizeStack<T>
extends java.util.LinkedList<T>

A Stack that has a limited capacity. If more elements are pushed in on top, oldest elements are "pushed out" at the bottom. In all other respects, this class behaves like any other stack implementation

Author:
gerry
See Also:
Serialized Form

Constructor Summary
LimitSizeStack(int limit)
           
 
Method Summary
 T pop()
           
 void push(T elem)
           
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList
 
Methods inherited from interface java.util.Deque
iterator
 

Constructor Detail

LimitSizeStack

public LimitSizeStack(int limit)
Method Detail

push

public void push(T elem)
Specified by:
push in interface java.util.Deque<T>
Overrides:
push in class java.util.LinkedList<T>

pop

public T pop()
Specified by:
pop in interface java.util.Deque<T>
Overrides:
pop in class java.util.LinkedList<T>

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis