本文整理了Java中java.util.concurrent.LinkedBlockingDeque.takeLast()
方法的一些代码示例,展示了LinkedBlockingDeque.takeLast()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LinkedBlockingDeque.takeLast()
方法的具体详情如下:
包路径:java.util.concurrent.LinkedBlockingDeque
类名称:LinkedBlockingDeque
方法名:takeLast
暂无
代码示例来源:origin: apache/hbase
/**
* Behaves as {@link LinkedBlockingQueue#take()}, except it will silently
* skip all calls which it thinks should be dropped.
*
* @return the head of this queue
* @throws InterruptedException if interrupted while waiting
*/
@Override
public CallRunner take() throws InterruptedException {
CallRunner cr;
while(true) {
if (((double) queue.size() / this.maxCapacity) > lifoThreshold) {
numLifoModeSwitches.increment();
cr = queue.takeLast();
} else {
cr = queue.takeFirst();
}
if (needToDrop(cr)) {
numGeneralCallsDropped.increment();
cr.drop();
} else {
return cr;
}
}
}
代码示例来源:origin: numenta/htm.java
/**
* Returns the item at the tail of this {@code Deque} or null
* if it is empty. This call does not block if empty.
*
* @return item at the tail of this {@code Deque} or null
* if it is empty.
*/
public E tail() {
E val = null;
try {
val = backingList.takeLast();
currentSize--;
}catch(Exception e) { e.printStackTrace(); }
return val;
}
代码示例来源:origin: numenta/htm.java
/**
* Returns the item at the tail of this {@code Deque} or null
* if it is empty. This call does not block if empty.
*
* @return item at the tail of this {@code Deque} or null
* if it is empty.
*/
public E takeLast() {
if(currentSize == 0) return null;
E val = null;
try {
val = backingList.takeLast();
currentSize--;
}catch(Exception e) { e.printStackTrace(); }
return val;
}
内容来源于网络,如有侵权,请联系作者删除!