Mercurial > hg > Members > nobuyasu > tightVNCProxy
view src/myVncProxy/MostRecentMultiCast.java @ 156:b570efb0d266
modify
author | e085711 |
---|---|
date | Fri, 07 Oct 2011 16:40:02 +0900 |
parents | 0cbe556e2c54 |
children |
line wrap: on
line source
package myVncProxy; import java.util.LinkedList; public class MostRecentMultiCast<T> extends MulticastQueue<T> { LinkedList<Node<T>> alive; int count = 0; MostRecentMultiCast(int limit) { count = limit; this.alive = new LinkedList<Node<T>>(); } @Override public synchronized void put(T item) { Node<T> next = new Node<T>(item); tail.set(next); tail = next; alive.addLast(next); if (alive.size()>count) { Node<T> old = alive.getFirst(); old.clear(); } } }