|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractQueue<E>
java.util.concurrent.PriorityBlockingQueue<E>
net.i2p.router.util.PriBlockingQueue<E>
public class PriBlockingQueue<E extends PQEntry>
Priority Blocking Queue using methods in the entries, as defined 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.
Field Summary | |
---|---|
protected I2PAppContext |
_context
|
protected Log |
_log
|
protected String |
_name
|
protected static int |
BACKLOG_SIZE
|
protected static int |
MAX_SIZE
|
protected static long[] |
RATES
|
Constructor Summary | |
---|---|
PriBlockingQueue(I2PAppContext ctx,
String name,
int initialCapacity)
Bounded queue with a hardcoded failsafe max size, except when using put(), which is unbounded. |
Method Summary | |
---|---|
boolean |
add(E o)
Deprecated. use offer(o) |
boolean |
isBacklogged()
Is the queue too big? |
boolean |
offer(E o)
Returns false if full |
boolean |
offer(E o,
long timeout,
TimeUnit unit)
Deprecated. use offer(o) |
void |
put(E o)
Deprecated. use offer(o) |
protected void |
timestamp(E o)
|
Methods inherited from class java.util.concurrent.PriorityBlockingQueue |
---|
clear, comparator, contains, drainTo, drainTo, iterator, peek, poll, poll, remainingCapacity, remove, size, take, toArray, toArray, toString |
Methods inherited from class java.util.AbstractQueue |
---|
addAll, element, remove |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, isEmpty, removeAll, retainAll |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Queue |
---|
element, remove |
Methods inherited from interface java.util.Collection |
---|
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll |
Field Detail |
---|
protected final transient I2PAppContext _context
protected final transient Log _log
protected final String _name
protected static final long[] RATES
protected static final int BACKLOG_SIZE
protected static final int MAX_SIZE
Constructor Detail |
---|
public PriBlockingQueue(I2PAppContext ctx, String name, int initialCapacity)
Method Detail |
---|
public boolean add(E o)
add
in interface Collection<E extends PQEntry>
add
in interface BlockingQueue<E extends PQEntry>
add
in interface Queue<E extends PQEntry>
add
in class PriorityBlockingQueue<E extends PQEntry>
public boolean offer(E o)
offer
in interface BlockingQueue<E extends PQEntry>
offer
in interface Queue<E extends PQEntry>
offer
in class PriorityBlockingQueue<E extends PQEntry>
public boolean offer(E o, long timeout, TimeUnit unit)
offer
in interface BlockingQueue<E extends PQEntry>
offer
in class PriorityBlockingQueue<E extends PQEntry>
timeout
- ignoredunit
- ignoredpublic void put(E o)
put
in interface BlockingQueue<E extends PQEntry>
put
in class PriorityBlockingQueue<E extends PQEntry>
public boolean isBacklogged()
protected void timestamp(E o)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |