public class ExpiryQueue<E> extends Object
Constructor and Description |
---|
ExpiryQueue(int expirationInterval) |
Modifier and Type | Method and Description |
---|---|
void |
dump(PrintWriter pwriter) |
Map<Long,Set<E>> |
getExpiryMap()
Returns an unmodifiable view of the expiration time -> elements mapping.
|
long |
getWaitTime() |
Set<E> |
poll()
Remove the next expired set of elements from expireMap.
|
Long |
remove(E elem)
Removes element from the queue.
|
Long |
update(E elem,
int timeout)
Adds or updates expiration time for element in queue, rounding the
timeout to the expiry interval bucketed used by this queue.
|
public Long remove(E elem)
elem
- element to removepublic Long update(E elem, int timeout)
elem
- element to add/updatetimeout
- timout in millisecondspublic long getWaitTime()
public Set<E> poll()
public void dump(PrintWriter pwriter)
Copyright © 2008–2020 The Apache Software Foundation. All rights reserved.