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

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

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

ArrayDeque.descendingIterator介绍

暂无

代码示例

代码示例来源:origin: shekhargulati/99-problems

public static <T> List<T> reverse_customStream(ArrayDeque<T> list) {
  if (list == null) {
    throw new IllegalArgumentException("list can't be null");
  }
  return StreamSupport.stream(Spliterators.spliteratorUnknownSize(list.descendingIterator(), Spliterator.ORDERED), false).collect(toList());
}

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

Iterator<Schema> reverseSchemas = schema.getFields().stream().map(Field::schema)
  .collect(Collectors.toCollection(ArrayDeque::new))
  .descendingIterator();
terminate = visitNonTerminal(visitor, schema, dq, () -> reverseSchemas);
visited.put(schema, schema);

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

@Override
public Iterator<ZFrame> descendingIterator()
{
  return frames.descendingIterator();
}

代码示例来源:origin: cycorp/api-suite

@Override
 public ProofViewNode next() {
  final ProofViewNode node = queue.remove();
  final List<? extends ProofViewNode> children = node.getChildren();
  //Add children to front of queue for depth-first traversal:
  for (final Iterator<ProofViewNode> it = new ArrayDeque<ProofViewNode>(children)
      .descendingIterator() ; it.hasNext() ;) {
   queue.addFirst(it.next());
  }
  return node;
 }
};

代码示例来源:origin: ripple-unmaintained/ripple-lib-java

private void copyInnersToDirtiedArray() {
  int ix = 0;
  dirtied = new ShaMapInner[inners.size()];
  Iterator<ShaMapInner> descending = inners.descendingIterator();
  while (descending.hasNext()) {
    ShaMapInner next = descending.next();
    dirtied[ix++] = next;
    next.invalidate();
  }
}

代码示例来源:origin: com.buschmais.jqassistant.plugin/jqassistant.plugin.yaml

public String buildNextFQN(String lastElement) {
    StringBuilder builder = new StringBuilder();

    Iterator<YAMLDescriptor> descItr = stackedContext.descendingIterator();

    while (descItr.hasNext()) {
      YAMLDescriptor yamld = descItr.next();

      if (YAMLKeyDescriptor.class.isAssignableFrom(yamld.getClass())) {
        YAMLKeyDescriptor keyDescriptor = (YAMLKeyDescriptor) yamld;
        builder.append(keyDescriptor.getName()).append('.');
      }
    }

    String name = builder.append(lastElement).toString();

    return name;
  }
}

代码示例来源:origin: com.sun.faces/jsf-impl

public void addBehaviors(FacesContext context,
             ClientBehaviorHolder behaviorHolder) {
  if ((behaviorStack == null) || behaviorStack.isEmpty()){
    return;
  }
  // Loop over pushed Behaviors and add to the ClientBehaviorHolder.
  // Note that we add most recently pushed behaviors first.  That
  // way the nearest behaviors take precedence.  Behaviors that were
  // pushed earlier won't be added since we'll already have a 
  // submitting behavior attached.
  Iterator<BehaviorInfo> descendingIter = behaviorStack.descendingIterator();
  while (descendingIter.hasNext()) {
    descendingIter.next().addBehavior(context, behaviorHolder);
  }
}

代码示例来源:origin: org.glassfish/javax.faces

public void addBehaviors(FacesContext context,
             ClientBehaviorHolder behaviorHolder) {
  if ((behaviorStack == null) || behaviorStack.isEmpty()){
    return;
  }
  // Loop over pushed Behaviors and add to the ClientBehaviorHolder.
  // Note that we add most recently pushed behaviors first.  That
  // way the nearest behaviors take precedence.  Behaviors that were
  // pushed earlier won't be added since we'll already have a 
  // submitting behavior attached.
  Iterator<BehaviorInfo> descendingIter = behaviorStack.descendingIterator();
  while (descendingIter.hasNext()) {
    descendingIter.next().addBehavior(context, behaviorHolder);
  }
}

代码示例来源:origin: org.glassfish/jakarta.faces

public void addBehaviors(FacesContext context,
             ClientBehaviorHolder behaviorHolder) {
  if ((behaviorStack == null) || behaviorStack.isEmpty()){
    return;
  }
  // Loop over pushed Behaviors and add to the ClientBehaviorHolder.
  // Note that we add most recently pushed behaviors first.  That
  // way the nearest behaviors take precedence.  Behaviors that were
  // pushed earlier won't be added since we'll already have a 
  // submitting behavior attached.
  Iterator<BehaviorInfo> descendingIter = behaviorStack.descendingIterator();
  while (descendingIter.hasNext()) {
    descendingIter.next().addBehavior(context, behaviorHolder);
  }
}

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

public void removeAll(UpdateDispatchView updateDispatchView) {
    ArrayDeque<Dispatchable> dispatchables = dispatchStateThreadLocal.get();
    Iterator<Dispatchable> it = dispatchables.descendingIterator();
    while (it.hasNext()) {
      Dispatchable dispatchable = it.next();
      if (dispatchable.getView() == updateDispatchView) {
        it.remove();
        dispatchable.cancelled();
      }
    }
  }
}

代码示例来源:origin: eclipse-ee4j/mojarra

public void addBehaviors(FacesContext context,
             ClientBehaviorHolder behaviorHolder) {
  if ((behaviorStack == null) || behaviorStack.isEmpty()){
    return;
  }
  // Loop over pushed Behaviors and add to the ClientBehaviorHolder.
  // Note that we add most recently pushed behaviors first.  That
  // way the nearest behaviors take precedence.  Behaviors that were
  // pushed earlier won't be added since we'll already have a 
  // submitting behavior attached.
  Iterator<BehaviorInfo> descendingIter = behaviorStack.descendingIterator();
  while (descendingIter.hasNext()) {
    descendingIter.next().addBehavior(context, behaviorHolder);
  }
}

代码示例来源:origin: net.sf.lightair/light-air

public static List<Map<String, Object>> create(
    Map<String, String> profileProperties,
    Map<String, Map<String, Map<String, Object>>> profileStructure,
    List<Map<String, Object>> dataset) {
  String schema = profileProperties.get(DATABASE_SCHEMA);
  Objects.requireNonNull(schema, "Database schema is required.");
  List<Map<String, Object>> statements = new ArrayList<>();
  dataset.stream()
      .map(row -> row.get(TABLE))
      .distinct() // only delete each table once
      .collect(toCollection(ArrayDeque::new))
      .descendingIterator() // delete tables in reverse order
      .forEachRemaining(tableName -> {
        statements.add(createStatement(schema, (String) tableName));
      });
  return Collections.unmodifiableList(statements);
}

代码示例来源:origin: dweiss/compound-splitter

public void decomposition(IntsRef utf32, ArrayDeque<Chunk> chunks)
  {
    if (builder.length() > 0)
      builder.append(",");
    boolean first = true;
    Iterator<Chunk> i = chunks.descendingIterator();
    while (i.hasNext())
    {
      Chunk chunk = i.next();
      if (chunk.type == ChunkType.WORD)
      {
        if (!first) builder.append('.');
        first = false;
        builder.append(chunk.toString());
      }
    }
  }
};

代码示例来源:origin: com.gitee.l0km/codegen-thrift

/**
 * 根据{@link ThriftStructDecorator}对象之间的依赖关系返回{@link ThriftStructDecorator}队列
 * @return
 */
protected List<ThriftStructDecorator> getGenSequence(){
  List<ThriftStructDecorator> list = BeanRelativeUtilits.sortByField(getAllStructDecorators(),"name");
  //List<ThriftStructDecorator> list = getAllStructDecorators();
  ArrayDeque<ThriftStructDecorator> seq = new ArrayDeque<>();
  for(ThriftStructDecorator struct:list){
    traverseMember(struct,seq);
  }
  return Lists.newArrayList(seq.descendingIterator());
}
private void traverseMember(ThriftStructDecorator parent,Deque<ThriftStructDecorator> seq){

代码示例来源:origin: org.kie/kie-dmn-feel

@Override
public Map<String, Object> getAllValues() {
  if (stack.peek().getRootObject() != null) {
    throw new RuntimeException();
  }
  int initialCapacity = (stack.peek().getAllValues().size() + stack.peekLast().getAllValues().size()) * 2;
  Map<String, Object> values = new HashMap<>(initialCapacity);
  Iterator<ExecutionFrame> it = stack.descendingIterator();
  while ( it.hasNext() ) {
    values.putAll( it.next().getAllValues() );
  }
  return values;
}

代码示例来源:origin: renekrie/querqy

private void addCompounds(final ArrayDeque<Term> terms, final boolean reverse) throws IOException {
  final CombineSuggestion[] combinations = suggestCombination(reverse
      ? terms.descendingIterator() : terms.iterator());
  if (combinations != null && combinations.length > 0) {
    final Term[] termArray;
    if (reverse) {
      termArray = new Term[terms.size()];
      int i = terms.size() - 1;
      final Iterator<Term> termIterator = terms.descendingIterator();
      while (termIterator.hasNext()) {
        termArray[i--] = termIterator.next();
      }
    } else {
      termArray = terms.toArray(new Term[0]);
    }
    for (final CombineSuggestion suggestion : combinations) {
      // add compound to each sibling that is part of the compound to maintain mm logic
      Arrays.stream(suggestion.originalTermIndexes)
          .mapToObj(idx -> termArray[idx])
          .forEach(sibling -> nodesToAdd.add(
              new Term(sibling.getParent(), sibling.getField(), suggestion.suggestion.string, true)));
    }
  }
}

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

@Subscribe
public void receiveSuiteEnd(SuiteCompletedEvent e) {
 target.post(new AggregatedSuiteResultEvent(
   startEvent,
   slave, 
   e.getDescription(), 
   suiteFailures, 
   Lists.newArrayList(tests.descendingIterator()), 
   eventStream,
   e.getStartTimestamp(), 
   e.getExecutionTime()));
 this.suiteFailures = null;
 this.lastSuite = null;
 this.startEvent = null;
 this.tests = null;
 this.eventStream = null;
}

代码示例来源:origin: PapenfussLab/gridss

private ArrayDeque<KmerPathSubnode> extendStartingAnchor(ArrayDeque<KmerPathSubnode> contig, int targetAnchorLength) {
  KmerPathNodePath startAnchorPath = new KmerPathNodePath(contig.getLast(), false, targetAnchorLength + maxEvidenceSupportIntervalWidth + contig.stream().mapToInt(sn -> sn.length()).sum());
  Iterator<KmerPathSubnode> it = contig.descendingIterator();
  it.next();
  startAnchorPath.push(it);
  startAnchorPath.greedyTraverse(true, false);
  return startAnchorPath.headNode().asSubnodes();
}
private boolean containsKmerRepeat(Collection<KmerPathSubnode> contig) {

代码示例来源:origin: anba/es6draft

private <STATEMENT extends Statement & AbruptNode> Object createLabelledStatement(STATEMENT node, Object body) {
  if (node.getLabelSet().isEmpty()) {
    return body;
  }
  Iterator<String> labels = new ArrayDeque<>(node.getLabelSet()).descendingIterator();
  while (labels.hasNext()) {
    Object label = createIdentifier(labels.next());
    if (hasBuilder(Type.LabeledStatement)) {
      body = call(Type.LabeledStatement, node, label, body);
    } else {
      OrdinaryObject statement = createStatement(node, Type.LabeledStatement);
      addProperty(statement, "label", label);
      addProperty(statement, "body", body);
      body = statement;
    }
  }
  return body;
}

代码示例来源:origin: com.carrotsearch.randomizedtesting/junit4-ant

@Subscribe
public void receiveSuiteEnd(SuiteCompletedEvent e) {
 target.post(new AggregatedSuiteResultEvent(
   startEvent,
   slave, 
   e.getDescription(), 
   suiteFailures, 
   Lists.newArrayList(tests.descendingIterator()), 
   eventStream,
   e.getStartTimestamp(), 
   e.getExecutionTime()));
 this.suiteFailures = null;
 this.lastSuite = null;
 this.startEvent = null;
 this.tests = null;
 this.eventStream = null;
}

相关文章

微信公众号

最新文章

更多