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

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

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

ArrayDeque.addAll介绍

暂无

代码示例

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

/**
 * Creates a new queue that contains the given elements.
 *
 * @param initialElements The elements to initially add to the queue.
 */
public ClosableBlockingQueue(Collection<? extends E> initialElements) {
  this(initialElements.size());
  this.elements.addAll(initialElements);
}

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

/**
 * Copy all pending entries in this queue into the destination queue.
 * @param dest to copy pending buffers to.
 */
public final void copyTo(AbstractCoalescingBufferQueue dest) {
  dest.bufAndListenerPairs.addAll(bufAndListenerPairs);
  dest.incrementReadableBytes(readableBytes);
}

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

/**
 * Copy all pending entries in this queue into the destination queue.
 * @param dest to copy pending buffers to.
 */
public final void copyTo(AbstractCoalescingBufferQueue dest) {
  dest.bufAndListenerPairs.addAll(bufAndListenerPairs);
  dest.incrementReadableBytes(readableBytes);
}

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

/**
 * Copy all pending entries in this queue into the destination queue.
 * @param dest to copy pending buffers to.
 */
public final void copyTo(AbstractCoalescingBufferQueue dest) {
  dest.bufAndListenerPairs.addAll(bufAndListenerPairs);
  dest.incrementReadableBytes(readableBytes);
}

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

/**
 * Constructs a deque containing the elements of the specified
 * collection, in the order they are returned by the collection's
 * iterator.  (The first element returned by the collection's
 * iterator becomes the first element, or <i>front</i> of the
 * deque.)
 *
 * @param c the collection whose elements are to be placed into the deque
 * @throws NullPointerException if the specified collection is null
 */
public ArrayDeque(Collection<? extends E> c) {
  allocateElements(c.size());
  addAll(c);
}

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

newQueue.addAll(memQueue);
memQueue = newQueue;
memoryCapacity = newMemoryCapacity;
ArrayDeque<Event> newQueue = new ArrayDeque<Event>(newMemoryCapacity);
if (memQueue != null) {
 newQueue.addAll(memQueue);

代码示例来源:origin: org.apache.lucene/lucene-core

private void rewriteToBlockSize(int targetBlockBits) {
 assert targetBlockBits <= maxBitsPerBlock;
 // We copy over data blocks to an output with one-larger block bit size.
 // We also discard references to blocks as we're copying to allow GC to
 // clean up partial results in case of memory pressure.
 ByteBuffersDataOutput cloned = new ByteBuffersDataOutput(targetBlockBits, targetBlockBits, blockAllocate, NO_REUSE);
 ByteBuffer block;
 while ((block = blocks.pollFirst()) != null) {
  block.flip();
  cloned.writeBytes(block);
  if (blockReuse != NO_REUSE) {
   blockReuse.accept(block);
  }
 }
 assert blocks.isEmpty();
 this.blockBits = targetBlockBits;
 blocks.addAll(cloned.blocks);
}

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

@SafeVarargs
private MockFetcher(HashMap<KafkaTopicPartition, Long>... stateSnapshotsToReturn) throws Exception {
  super(
      new TestSourceContext<>(),
      new HashMap<>(),
      null,
      null,
      new TestProcessingTimeService(),
      0,
      MockFetcher.class.getClassLoader(),
      new UnregisteredMetricsGroup(),
      false);
  this.stateSnapshotsToReturn.addAll(Arrays.asList(stateSnapshotsToReturn));
}

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

worklist.addAll(getAllImplementersOfInterface(concreteType));
continue;
worklist.addAll(c);

代码示例来源:origin: Alluxio/alluxio

@Override
public ObjectStatus[] getObjectStatuses() {
 ArrayDeque<DirectoryOrObject> objects = new ArrayDeque<>();
 Container container = mAccount.getContainer(mContainerName);
 if (!mRecursive) {
  objects.addAll(container.listDirectory(mPaginationMap.getPrefix(), PATH_SEPARATOR_CHAR,
    mPaginationMap.getMarker(mPage), mPaginationMap.getPageSize()));
 } else {
  objects.addAll(container.list(mPaginationMap, mPage));
 }
 int i = 0;
 ObjectStatus[] res = new ObjectStatus[objects.size()];
 for (DirectoryOrObject object : objects) {
  if (object.isObject()) {
   res[i++] = new ObjectStatus(object.getName(), object.getAsObject().getEtag(),
     object.getAsObject().getContentLength(),
     object.getAsObject().getLastModifiedAsDate().getTime());
  } else {
   res[i++] = new ObjectStatus(object.getName());
  }
 }
 return res;
}

代码示例来源:origin: facebook/litho

nodesToProcess.addAll(leafNodes);

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

queue.addAll(cl.getInterfaces());
while (true) {
 SootClass iface = queue.poll();
  return checkStatic(ifaceField);
 queue.addAll(iface.getInterfaces());

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
 * Add all of the tables, in the specified order.
 * <p>
 * Unconditionally adds all tables, ignoring the
 * {@link #setCompactBytesLimit(long)}.
 *
 * @param readers
 *            tables to compact. Tables should be ordered oldest first/most
 *            recent last so that the more recent tables can shadow the
 *            older results. Caller is responsible for closing the readers.
 * @throws java.io.IOException
 *             update indexes of a reader cannot be accessed.
 */
public void addAll(List<? extends Reftable> readers) throws IOException {
  tables.addAll(readers);
  for (Reftable r : readers) {
    if (r instanceof ReftableReader) {
      adjustUpdateIndexes((ReftableReader) r);
    }
  }
}

代码示例来源:origin: INRIA/spoon

/**
   * Dereference the "iterator"
   *
   * @return CtElement the next element in DFS order without going down the tree
   */
  @Override
  public CtElement next() {
    CtElement next = deque.pollFirst(); // get the element to expand from the deque
    current_children.clear(); // clear for this scan
    next.accept(this); // call @scan for each direct child of the node
    deque.addAll(current_children); // overridden method to add all to first
    return next;
  }
}

代码示例来源:origin: hazelcast/hazelcast-jet

/**
 * Convenience for {@code inbox.queue().addAll(collection)}
 */
public void addAll(Collection<?> collection) {
  queue.addAll(collection);
}

代码示例来源:origin: org.apache.flink/flink-connector-kafka-0.8_2.10

/**
 * Creates a new queue that contains the given elements.
 * 
 * @param initialElements The elements to initially add to the queue.
 */
public ClosableBlockingQueue(Collection<? extends E> initialElements) {
  this(initialElements.size());
  this.elements.addAll(initialElements);
}

代码示例来源:origin: espertechinc/esper

public static void checkedPayloadAddAll(ArrayDeque<EventBean> events, Object value) {
  if (value instanceof EventBean) {
    events.add((EventBean) value);
    return;
  }
  ArrayDeque<EventBean> q = (ArrayDeque<EventBean>) value;
  events.addAll(q);
}

代码示例来源:origin: apache/activemq-artemis

/**
 * Copy all pending entries in this queue into the destination queue.
 * @param dest to copy pending buffers to.
 */
public final void copyTo(AbstractCoalescingBufferQueue dest) {
  dest.bufAndListenerPairs.addAll(bufAndListenerPairs);
  dest.incrementReadableBytes(readableBytes);
}

代码示例来源:origin: apache/activemq-artemis

/**
 * Copy all pending entries in this queue into the destination queue.
 * @param dest to copy pending buffers to.
 */
public final void copyTo(AbstractCoalescingBufferQueue dest) {
  dest.bufAndListenerPairs.addAll(bufAndListenerPairs);
  dest.incrementReadableBytes(readableBytes);
}

代码示例来源:origin: org.apache.ratis/ratis-proto-shaded

/**
 * Copy all pending entries in this queue into the destination queue.
 * @param dest to copy pending buffers to.
 */
public final void copyTo(AbstractCoalescingBufferQueue dest) {
  dest.bufAndListenerPairs.addAll(bufAndListenerPairs);
  dest.incrementReadableBytes(readableBytes);
}

相关文章

微信公众号

最新文章

更多