Create LIFOBlockingDeque.java
Add support for LIFO blocking queue (deque actually)
This commit is contained in:
parent
a0d9cf8e80
commit
7bbfcc0b7e
1 changed files with 18 additions and 0 deletions
18
OsmAnd-java/src/net/osmand/util/LIFOBlockingDeque.java
Normal file
18
OsmAnd-java/src/net/osmand/util/LIFOBlockingDeque.java
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
package net.osmand.util;
|
||||||
|
|
||||||
|
import java.util.concurrent.LinkedBlockingDeque;
|
||||||
|
|
||||||
|
public class LIFOBlockingDeque<T> extends LinkedBlockingDeque<T> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean offer(T t) {
|
||||||
|
return super.offerFirst(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public T remove() {
|
||||||
|
return super.removeFirst();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue