net.i2p.router.util
Class PriBlockingQueue<E extends PQEntry>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractQueue<E>
java.util.concurrent.PriorityBlockingQueue<E>
net.i2p.router.util.PriBlockingQueue<E>
- All Implemented Interfaces:
- Serializable, Iterable<E>, Collection<E>, BlockingQueue<E>, Queue<E>
- Direct Known Subclasses:
- CoDelPriorityBlockingQueue
public class PriBlockingQueue<E extends PQEntry>
- extends PriorityBlockingQueue<E>
Priority Blocking Queue using methods in the entries,
as definied in PQEntry, to store priority and sequence number,
ensuring FIFO order within a priority.
Input: add(), offer(), and put() are overridden to add a sequence number.
- Since:
- 0.9.3
- See Also:
- Serialized Form
Methods inherited from class java.util.concurrent.PriorityBlockingQueue |
clear, comparator, contains, drainTo, drainTo, iterator, peek, poll, poll, remainingCapacity, remove, size, take, toArray, toArray, toString |
BACKLOG_SIZE
protected static final int BACKLOG_SIZE
- See Also:
- Constant Field Values
PriBlockingQueue
public PriBlockingQueue(int initialCapacity)
add
public boolean add(E o)
- Specified by:
add
in interface Collection<E extends PQEntry>
- Specified by:
add
in interface BlockingQueue<E extends PQEntry>
- Specified by:
add
in interface Queue<E extends PQEntry>
- Overrides:
add
in class PriorityBlockingQueue<E extends PQEntry>
offer
public boolean offer(E o)
- Specified by:
offer
in interface BlockingQueue<E extends PQEntry>
- Specified by:
offer
in interface Queue<E extends PQEntry>
- Overrides:
offer
in class PriorityBlockingQueue<E extends PQEntry>
offer
public boolean offer(E o,
long timeout,
TimeUnit unit)
- Specified by:
offer
in interface BlockingQueue<E extends PQEntry>
- Overrides:
offer
in class PriorityBlockingQueue<E extends PQEntry>
put
public void put(E o)
- Specified by:
put
in interface BlockingQueue<E extends PQEntry>
- Overrides:
put
in class PriorityBlockingQueue<E extends PQEntry>
isBacklogged
public boolean isBacklogged()
- Is the queue too big?
timestamp
protected void timestamp(E o)