java.util.ArrayDeque.pollLast()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(140)

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

ArrayDeque.pollLast介绍

暂无

代码示例

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

/**
 * @throws NoSuchElementException {@inheritDoc}
 */
public E removeLast() {
  E x = pollLast();
  if (x == null)
    throw new NoSuchElementException();
  return x;
}

代码示例来源:origin: io.dropwizard.metrics/metrics-core

private Chunk allocateChunk() {
  while (true) {
    final SoftReference<Chunk> chunkRef = chunksCache.pollLast();
    if (chunkRef == null) {
      return new Chunk(defaultChunkSize);
    }
    final Chunk chunk = chunkRef.get();
    if (chunk != null) {
      chunk.cursor = 0;
      chunk.startIndex = 0;
      chunk.chunkSize = chunk.keys.length;
      return chunk;
    }
  }
}

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

ByteBuffer last = queue.pollLast();
if (last != null) {
  last.compact();

代码示例来源:origin: Sable/soot

Edge edge = worklist.pollLast();
AbstractInsnNode insn = edge.insn;
stack = edge.stack;

代码示例来源:origin: PebbleTemplates/pebble

private static Collection<String> resolvePathSegments(Collection<String> anchorSegments,
  Collection<String> relativeSegments) {
 ArrayDeque<String> result = new ArrayDeque<>(anchorSegments);
 for (String segment : relativeSegments) {
  if (segment.equals(".")) {
   // do nothing
  } else if (segment.equals("..")) {
   result.pollLast();
  } else {
   result.add(segment);
  }
 }
 return result;
}

代码示例来源:origin: PebbleTemplates/pebble

private static Collection<String> determineAnchorPathSegments(String anchorPath, char separator) {
 if (anchorPath == null || anchorPath.isEmpty()) {
  return new ArrayList<>();
 }
 ArrayDeque<String> anchorPathSegments = new ArrayDeque<>(
   splitBySeparator(anchorPath, separator));
 if (anchorPath.charAt(anchorPath.length() - 1) != separator) {
  anchorPathSegments.pollLast();
 }
 return anchorPathSegments;
}

代码示例来源:origin: BaseXdb/basex

/**
 * Removes the current query focus from the stack.
 */
public void removeFocus() {
 qc.focus = focuses.pollLast();
}

代码示例来源:origin: org.zeromq/jeromq

@Override
public ZFrame removeLast()
{
  return frames.pollLast();
}

代码示例来源:origin: org.basex/basex

/**
 * Removes the current query focus from the stack.
 */
public void removeFocus() {
 qc.focus = focuses.pollLast();
}

代码示例来源:origin: org.zeromq/jeromq

@Override
public ZFrame pollLast()
{
  return frames.pollLast();
}

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

/**
 * @throws NoSuchElementException {@inheritDoc}
 */
public E removeLast() {
  E x = pollLast();
  if (x == null)
    throw new NoSuchElementException();
  return x;
}

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

/**
 * @throws NoSuchElementException {@inheritDoc}
 */
public E removeLast() {
  E x = pollLast();
  if (x == null)
    throw new NoSuchElementException();
  return x;
}

代码示例来源:origin: us.ihmc/IHMCCommunication

/**
* Warning: The returned element will be reused and modified by this deque when adding a new element.
* {@inheritDoc}
*/
@Override
public C pollLast()
{
 C commandToReturn = super.pollLast();
 unusedCommands.add(commandToReturn);
 return commandToReturn;
}

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

/**
 * @throws NoSuchElementException {@inheritDoc}
 */
public E removeLast() {
  E x = pollLast();
  if (x == null)
    throw new NoSuchElementException();
  return x;
}

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

/**
 * @throws NoSuchElementException {@inheritDoc}
 */
public E removeLast() {
  E x = pollLast();
  if (x == null)
    throw new NoSuchElementException();
  return x;
}

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

/**
 * @throws NoSuchElementException {@inheritDoc}
 */
public E removeLast() {
  E x = pollLast();
  if (x == null)
    throw new NoSuchElementException();
  return x;
}

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

/**
 * @throws NoSuchElementException {@inheritDoc}
 */
public E removeLast() {
  E x = pollLast();
  if (x == null)
    throw new NoSuchElementException();
  return x;
}

代码示例来源:origin: com.mitchellbosecke/pebble

private static Collection<String> determineAnchorPathSegments(String anchorPath, char separator) {
  if (anchorPath == null || anchorPath.isEmpty()) {
    return new ArrayList<>();
  }
  ArrayDeque<String> anchorPathSegments = new ArrayDeque<>(splitBySeparator(anchorPath, separator));
  if (anchorPath.charAt(anchorPath.length() - 1) != separator) {
    anchorPathSegments.pollLast();
  }
  return anchorPathSegments;
}

代码示例来源:origin: io.pebbletemplates/pebble

private static Collection<String> determineAnchorPathSegments(String anchorPath, char separator) {
 if (anchorPath == null || anchorPath.isEmpty()) {
  return new ArrayList<>();
 }
 ArrayDeque<String> anchorPathSegments = new ArrayDeque<>(
   splitBySeparator(anchorPath, separator));
 if (anchorPath.charAt(anchorPath.length() - 1) != separator) {
  anchorPathSegments.pollLast();
 }
 return anchorPathSegments;
}

代码示例来源:origin: org.apache.santuario/xmlsec

@Override
  public XMLSecEvent processNextEvent(InputProcessorChain inputProcessorChain)
      throws XMLStreamException, XMLSecurityException {
    if (!xmlSecEventList.isEmpty()) {
      return xmlSecEventList.pollLast();
    } else {
      inputProcessorChain.removeProcessor(this);
      return inputProcessorChain.processEvent();
    }
  }
}

相关文章

微信公众号

最新文章

更多