@@ -0,0 +1,1747 @@
+package railo.commons.collection;%0A%0Aimport java.util.Collection;%0Aimport java.util.Iterator;%0Aimport java.util.LinkedList;%0Aimport java.util.Queue;%0A%0Apublic class QueueMaxSize%3CE%3E implements Queue%3CE%3E %7B%0A%09%0A%09private int maxSize;%0A%09private LinkedList%3CE%3E list=new LinkedList%3CE%3E();%0A%0A%09public QueueMaxSize(int maxSize)%7B%0A%09%09this.maxSize=maxSize;%0A%09%7D%0A%0A%0A%09@Override%0A%09public boolean add(E e) %7B%0A%09%09if(!list.add(e)) return false;%0A        while (size() %3E maxSize) %7B list.remove(); %7D%0A        return true;%0A%09%7D%0A%0A%09public int size() %7B%0A%09%09return list.size();%0A%09%7D%0A%0A%09public boolean contains(Object o) %7B%0A%09%09return list.contains(o);%0A%09%7D%0A%0A%09public Iterator%3CE%3E iterator() %7B%0A%09%09return list.iterator();%0A%09%7D%0A%0A%09public %3CT%3E T%5B%5D toArray(T%5B%5D a) %7B%0A%09%09return list.toArray(a);%0A%09%7D%0A%0A%09public boolean remove(Object o) %7B%0A%09%09return list.remove(o);%0A%09%7D%0A%0A%09public void clear() %7B%0A%09%09list.clear();%0A%09%7D%0A%09%0A%09public E remove() %7B%0A%09%09return list.remove();%0A%09%7D%0A%0A%09public E poll() %7B%0A%09%09return list.poll();%0A%09%7D%0A%0A%09public E element() %7B%0A%09%09return list.element();%0A%09%7D%0A%0A%09public E peek() %7B%0A%09%09throw new UnsupportedOperationException();%0A%09%7D%0A%0A%0A%09@Override%0A%09public boolean isEmpty() %7B%0A%09%09throw new UnsupportedOperationException();%0A%09%7D%0A%0A%0A%09@Override%0A%09public Object%5B%5D toArray() %7B%0A%09%09throw new UnsupportedOperationException();%0A%09%7D%0A%0A%0A%09@Override%0A%09public boolean containsAll(Collection%3C?%3E c) %7B%0A%09%09throw new UnsupportedOperationException();%0A%09%7D%0A%0A%0A%09@Override%0A%09public boolean addAll(Collection%3C? extends E%3E c) %7B%0A%09%09throw new UnsupportedOperationException();%0A%09%7D%0A%0A%0A%09@Override%0A%09public boolean removeAll(Collection%3C?%3E c) %7B%0A%09%09throw new UnsupportedOperationException();%0A%09%7D%0A%0A%0A%09@Override%0A%09public boolean retainAll(Collection%3C?%3E c) %7B%0A%09%09throw new UnsupportedOperationException();%0A%09%7D%0A%0A%0A%09@Override%0A%09public boolean offer(E e) %7B%0A%09%09throw new UnsupportedOperationException();%0A%09%7D%0A%7D%0A

add a new class that allows to create a Queue with a limited size, where the oldest records get removed automaticly when the max size is reached