java.util.concurrent.LinkedBlockingDeque.getFirst()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中java.util.concurrent.LinkedBlockingDeque.getFirst()方法的一些代码示例,展示了LinkedBlockingDeque.getFirst()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LinkedBlockingDeque.getFirst()方法的具体详情如下:
包路径:java.util.concurrent.LinkedBlockingDeque
类名称:LinkedBlockingDeque
方法名:getFirst

LinkedBlockingDeque.getFirst介绍

暂无

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Retrieves, but does not remove, the head of the queue represented by
 * this deque.  This method differs from {@link #peek peek} only in that
 * it throws an exception if this deque is empty.
 *
 * <p>This method is equivalent to {@link #getFirst() getFirst}.
 *
 * @return the head of the queue represented by this deque
 * @throws NoSuchElementException if this deque is empty
 */
public E element() {
  return getFirst();
}

代码示例来源:origin: apache/zookeeper

private Packet findSendablePacket(LinkedBlockingDeque<Packet> outgoingQueue,
                 boolean tunneledAuthInProgres) {
  if (outgoingQueue.isEmpty()) {
    return null;
  }
  // If we've already starting sending the first packet, we better finish
  if (outgoingQueue.getFirst().bb != null || !tunneledAuthInProgres) {
    return outgoingQueue.getFirst();
  }
  // Since client's authentication with server is in progress,
  // send only the null-header packet queued by primeConnection().
  // This packet must be sent so that the SASL authentication process
  // can proceed, but all other packets should wait until
  // SASL authentication completes.
  Iterator<Packet> iter = outgoingQueue.iterator();
  while (iter.hasNext()) {
    Packet p = iter.next();
    if (p.requestHeader == null) {
      // We've found the priming-packet. Move it to the beginning of the queue.
      iter.remove();
      outgoingQueue.addFirst(p);
      return p;
    } else {
      // Non-priming packet: defer it until later, leaving it in the queue
      // until authentication completes.
      LOG.debug("deferring non-priming packet {} until SASL authentation completes.", p);
    }
  }
  return null;
}

代码示例来源:origin: ibinti/bugvm

/**
 * Retrieves, but does not remove, the head of the queue represented by
 * this deque.  This method differs from {@link #peek peek} only in that
 * it throws an exception if this deque is empty.
 *
 * <p>This method is equivalent to {@link #getFirst() getFirst}.
 *
 * @return the head of the queue represented by this deque
 * @throws NoSuchElementException if this deque is empty
 */
public E element() {
  return getFirst();
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Retrieves, but does not remove, the head of the queue represented by
 * this deque.  This method differs from {@link #peek peek} only in that
 * it throws an exception if this deque is empty.
 *
 * <p>This method is equivalent to {@link #getFirst() getFirst}.
 *
 * @return the head of the queue represented by this deque
 * @throws NoSuchElementException if this deque is empty
 */
public E element() {
  return getFirst();
}

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

/**
 * Retrieves, but does not remove, the head of the queue represented by
 * this deque.  This method differs from {@link #peek peek} only in that
 * it throws an exception if this deque is empty.
 *
 * <p>This method is equivalent to {@link #getFirst() getFirst}.
 *
 * @return the head of the queue represented by this deque
 * @throws NoSuchElementException if this deque is empty
 */
public E element() {
  return getFirst();
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Retrieves, but does not remove, the head of the queue represented by
 * this deque.  This method differs from {@link #peek peek} only in that
 * it throws an exception if this deque is empty.
 *
 * <p>This method is equivalent to {@link #getFirst() getFirst}.
 *
 * @return the head of the queue represented by this deque
 * @throws NoSuchElementException if this deque is empty
 */
public E element() {
  return getFirst();
}

代码示例来源:origin: MobiVM/robovm

/**
 * Retrieves, but does not remove, the head of the queue represented by
 * this deque.  This method differs from {@link #peek peek} only in that
 * it throws an exception if this deque is empty.
 *
 * <p>This method is equivalent to {@link #getFirst() getFirst}.
 *
 * @return the head of the queue represented by this deque
 * @throws NoSuchElementException if this deque is empty
 */
public E element() {
  return getFirst();
}

代码示例来源:origin: jtulach/bck2brwsr

/**
 * Retrieves, but does not remove, the head of the queue represented by
 * this deque.  This method differs from {@link #peek peek} only in that
 * it throws an exception if this deque is empty.
 *
 * <p>This method is equivalent to {@link #getFirst() getFirst}.
 *
 * @return the head of the queue represented by this deque
 * @throws NoSuchElementException if this deque is empty
 */
public E element() {
  return getFirst();
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Retrieves, but does not remove, the head of the queue represented by
 * this deque.  This method differs from {@link #peek peek} only in that
 * it throws an exception if this deque is empty.
 *
 * <p>This method is equivalent to {@link #getFirst() getFirst}.
 *
 * @return the head of the queue represented by this deque
 * @throws NoSuchElementException if this deque is empty
 */
public E element() {
  return getFirst();
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Retrieves, but does not remove, the head of the queue represented by
 * this deque.  This method differs from {@link #peek peek} only in that
 * it throws an exception if this deque is empty.
 *
 * <p>This method is equivalent to {@link #getFirst() getFirst}.
 *
 * @return the head of the queue represented by this deque
 * @throws NoSuchElementException if this deque is empty
 */
public E element() {
  return getFirst();
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * Retrieves, but does not remove, the head of the queue represented by
 * this deque.  This method differs from {@link #peek peek} only in that
 * it throws an exception if this deque is empty.
 *
 * <p>This method is equivalent to {@link #getFirst() getFirst}.
 *
 * @return the head of the queue represented by this deque
 * @throws NoSuchElementException if this deque is empty
 */
public E element() {
  return getFirst();
}

代码示例来源:origin: EvoSuite/evosuite

public void testMe(LinkedBlockingDeque<Integer> integerDeque) {
    int x = integerDeque.getFirst();
  }
}

代码示例来源:origin: org.alfresco/alfresco-solrclient-lib

public T getLast()
{
  return getDeque().getFirst();
}

相关文章

微信公众号

最新文章

更多