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

x33g5p2x  于2022-01-17 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(203)

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

Deque.addAll介绍

暂无

代码示例

代码示例来源:origin: btraceio/btrace

@Override
public synchronized boolean addAll(Collection<? extends V> c) {
  return delegate.addAll(c);
}

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

/**
 * Update assigned variables in a temporary stack.
 */
private void updateCurrentScopeAssignedVariables() {
  // -@cs[MoveVariableInsideIf] assignment value is a modification call so it can't be moved
  final Deque<DetailAST> poppedScopeAssignedVariableData =
      currentScopeAssignedVariables.pop();
  final Deque<DetailAST> currentScopeAssignedVariableData =
      currentScopeAssignedVariables.peek();
  if (currentScopeAssignedVariableData != null) {
    currentScopeAssignedVariableData.addAll(poppedScopeAssignedVariableData);
  }
}

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

void addValues(final HttpString name, Deque<String> value) {
  Deque<String> values = this.values.get(name);
  for(String i : value) {
    checkStringForSuspiciousCharacters(i);
  }
  if (values == null) {
    this.values.put(name, value);
  } else {
    values.addAll(value);
  }
}

代码示例来源:origin: google/guava

@Override
public boolean addAll(Collection<? extends E> collection) {
 assertTrue(Thread.holdsLock(mutex));
 return delegate.addAll(collection);
}

代码示例来源:origin: org.springframework.boot/spring-boot

private void addIncludedProfiles(Set<Profile> includeProfiles) {
  LinkedList<Profile> existingProfiles = new LinkedList<>(this.profiles);
  this.profiles.clear();
  this.profiles.addAll(includeProfiles);
  this.profiles.removeAll(this.processedProfiles);
  this.profiles.addAll(existingProfiles);
}

代码示例来源:origin: CalebFenton/simplify

@Override
public ExecutionNode next() {
  ExecutionNode result = stack.poll();
  stack.addAll(result.getChildren());
  return result;
}

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

public static Map<String, Deque<String>> mergeQueryParametersWithNewQueryString(final Map<String, Deque<String>> queryParameters, final String newQueryString, final String encoding) {
  Map<String, Deque<String>> newQueryParameters = parseQueryString(newQueryString, encoding);
  //according to the spec the new query parameters have to 'take precedence'
  for (Map.Entry<String, Deque<String>> entry : queryParameters.entrySet()) {
    if (!newQueryParameters.containsKey(entry.getKey())) {
      newQueryParameters.put(entry.getKey(), new ArrayDeque<>(entry.getValue()));
    } else {
      newQueryParameters.get(entry.getKey()).addAll(entry.getValue());
    }
  }
  return newQueryParameters;
}

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

public static Set<Class<?>> getImplementedInterfaces(Class<?> cl) {
  Set<Class<?>> interfaces = new HashSet<Class<?>>();
  Deque<Class<?>> classes = new ArrayDeque<Class<?>>();
  classes.add(cl);
  while (!classes.isEmpty()) {
    Class<?> c = classes.pop();
    interfaces.addAll(Arrays.asList(c.getInterfaces()));
    if (c.getSuperclass() != null) {
      classes.add(c.getSuperclass());
    }
    classes.addAll(Arrays.asList(c.getInterfaces()));
  }
  return interfaces;
}

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

/**
 * Copy the stack for a parallel thread.
 * @return a copy.
 */
public LocalPropertyStack copy() {
  synchronized (LOCK) {
    LocalPropertyStack ret = new LocalPropertyStack();
    ret.stack.addAll(stack);
    return ret;
  }
}

代码示例来源:origin: org.apache.commons/commons-compress

private Pair splitWithNewBackReferenceLengthOf(int newBackReferenceLength) {
    Pair p = new Pair();
    p.literals.addAll(literals);
    p.brOffset = brOffset;
    p.brLength = newBackReferenceLength;
    return p;
  }
}

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

/**
 * Adds all of the elements in the specified collection at the end of this deque.
 * <p />
 * Note: If collection being added can mutate concurrently, or underlying deque implementation allows partial
 * insertion, then subsequent calls to {@link #size()} can report incorrect value.
 *
 * @param col The elements to be inserted into this deque.
 * @return {@code true} if this deque changed as a result of the call.
 */
@Override public boolean addAll(@NotNull Collection<? extends E> col) {
  int colSize = col.size();
  boolean res = deque.addAll(col);
  if (res)
    adder.add(colSize);
  return res;
}

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

private void walkSubtree(Operator<?> root) {
 Deque<Operator<?>> deque = new LinkedList<>();
 deque.add(root);
 while (!deque.isEmpty()) {
  Operator<?> op = deque.pollLast();
  mark(op);
  if (op instanceof ReduceSinkOperator) {
   // Done with this branch
  } else {
   deque.addAll(op.getChildOperators());
  }
 }
}

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

private Set<Set<Operator<?>>> getComponents(OptimizeTezProcContext procCtx) {
 Deque<Operator<?>> deque = new LinkedList<Operator<?>>();
 deque.addAll(procCtx.parseContext.getTopOps().values());
 AtomicInteger index = new AtomicInteger();
 Map<Operator<?>, Integer> indexes = new HashMap<Operator<?>, Integer>();
 Map<Operator<?>, Integer> lowLinks = new HashMap<Operator<?>, Integer>();
 Stack<Operator<?>> nodes = new Stack<Operator<?>>();
 Set<Set<Operator<?>>> components = new LinkedHashSet<Set<Operator<?>>>();
 for (Operator<?> o : deque) {
  if (!indexes.containsKey(o)) {
   connect(o, index, nodes, indexes, lowLinks, components, procCtx.parseContext);
  }
 }
 return components;
}

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

public static Operator<?> findOperatorByMarker(Operator<?> start, String marker) {
 Deque<Operator<?>> queue = new ArrayDeque<>();
 queue.add(start);
 while (!queue.isEmpty()) {
  Operator<?> op = queue.remove();
  if (marker.equals(op.getMarker())) {
   return op;
  }
  if (op.getChildOperators() != null) {
   queue.addAll(op.getChildOperators());
  }
 }
 return null;
}

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

@Implementation
protected void set(Matrix src) {
 reset();
 if (src != null) {
  ShadowMatrix shadowMatrix = Shadow.extract(src);
  preOps.addAll(shadowMatrix.preOps);
  postOps.addAll(shadowMatrix.postOps);
  setOps.putAll(shadowMatrix.setOps);
  simpleMatrix = new SimpleMatrix(getSimpleMatrix(src));
 }
}

代码示例来源:origin: ben-manes/caffeine

@Override public Queue<LinkedValue> create(LinkedValue[] elements) {
  Deque<LinkedValue> deque = useTarget ? supplier.get() : new ArrayDeque<>();
  deque.addAll(MinimalCollection.of(elements));
  useTarget = false;
  return deque;
 }
})

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

Deque<String> asDeqeue(String... args) {
  Deque<String> dq = new ArrayDeque<>();
  List<String> x = Arrays.asList(args);
  Collections.reverse(x);
  dq.addAll(x);
  return dq;
 }
}

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

private void runDynamicPartitionPruning(OptimizeTezProcContext procCtx, Set<ReadEntity> inputs,
  Set<WriteEntity> outputs) throws SemanticException {
 if (!procCtx.conf.getBoolVar(ConfVars.TEZ_DYNAMIC_PARTITION_PRUNING)) {
  return;
 }
 // Sequence of TableScan operators to be walked
 Deque<Operator<?>> deque = new LinkedList<Operator<?>>();
 deque.addAll(procCtx.parseContext.getTopOps().values());
 Map<Rule, NodeProcessor> opRules = new LinkedHashMap<Rule, NodeProcessor>();
 opRules.put(
   new RuleRegExp(new String("Dynamic Partition Pruning"), FilterOperator.getOperatorName()
     + "%"), new DynamicPartitionPruningOptimization());
 // The dispatcher fires the processor corresponding to the closest matching
 // rule and passes the context along
 Dispatcher disp = new DefaultRuleDispatcher(null, opRules, procCtx);
 List<Node> topNodes = new ArrayList<Node>();
 topNodes.addAll(procCtx.parseContext.getTopOps().values());
 GraphWalker ogw = new ForwardWalker(disp);
 ogw.startWalking(topNodes, null);
}

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

@Override
public TestExecutor<T> andGivenCommands(List<?> commands) {
  finalizeConfiguration();
  for (Object command : commands) {
    ExecutionExceptionAwareCallback callback = new ExecutionExceptionAwareCallback();
    executeAtSimulatedTime(() -> commandBus.dispatch(GenericCommandMessage.asCommandMessage(command), callback));
    callback.assertSuccessful();
    givenEvents.addAll(storedEvents);
    storedEvents.clear();
  }
  publishedEvents.clear();
  return this;
}

代码示例来源:origin: google/guava

create().remove();
create().add("foo");
create().addAll(ImmutableList.of("foo"));
create().clear();
create().contains("foo");

相关文章