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

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

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

Deque.descendingIterator介绍

[英]Returns an iterator over the elements in this deque in reverse sequential order. The elements will be returned in order from last (tail) to first (head).
[中]

代码示例

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

@Override
public Iterator<E> descendingIterator() {
 synchronized (mutex) {
  return delegate().descendingIterator();
 }
}

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

@Override
public synchronized Iterator<V> descendingIterator() {
  return delegate.descendingIterator();
}

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

@Override
public Iterator<E> descendingIterator() {
 synchronized (mutex) {
  return delegate().descendingIterator();
 }
}

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

@Override
public Iterator<E> descendingIterator() {
 return delegate().descendingIterator();
}

代码示例来源:origin: apache/incubator-druid

private Iterable<IncrementalIndexRow> timeOrderedConcat(
  final Iterable<Deque<IncrementalIndexRow>> iterable,
  final boolean descending
)
{
 return () -> Iterators.concat(
   Iterators.transform(
     iterable.iterator(),
     input -> descending ? input.descendingIterator() : input.iterator()
   )
 );
}

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

/**
 * Clear out all the in-flight requests for the given node and return them
 *
 * @param node The node
 * @return All the in-flight requests for that node that have been removed
 */
public Iterable<NetworkClient.InFlightRequest> clearAll(String node) {
  Deque<NetworkClient.InFlightRequest> reqs = requests.get(node);
  if (reqs == null) {
    return Collections.emptyList();
  } else {
    final Deque<NetworkClient.InFlightRequest> clearedRequests = requests.remove(node);
    inFlightRequestCount.getAndAdd(-clearedRequests.size());
    return () -> clearedRequests.descendingIterator();
  }
}

代码示例来源:origin: prestodb/presto

@Override
public Iterator<E> descendingIterator() {
 synchronized (mutex) {
  return delegate().descendingIterator();
 }
}

代码示例来源:origin: real-logic/simple-binary-encoding

private void printScope()
  {
    final Iterator<String> i = namedScope.descendingIterator();
    while (i.hasNext())
    {
      out.print(i.next());
    }
  }
}

代码示例来源:origin: prestodb/presto

@Override
public Iterator<E> descendingIterator() {
 return delegate().descendingIterator();
}

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

@Override
public Iterator<E> descendingIterator() {
 assertTrue(Thread.holdsLock(mutex));
 return delegate.descendingIterator();
}

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

@Override
public Iterator<E> descendingIterator() {
 return delegate().descendingIterator();
}

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

/**
 * Gets final variable candidate for ast.
 * @param ast ast.
 * @return Optional of {@link FinalVariableCandidate} for ast from scopeStack.
 */
private Optional<FinalVariableCandidate> getFinalCandidate(DetailAST ast) {
  Optional<FinalVariableCandidate> result = Optional.empty();
  final Iterator<ScopeData> iterator = scopeStack.descendingIterator();
  while (iterator.hasNext() && !result.isPresent()) {
    final ScopeData scopeData = iterator.next();
    result = scopeData.findFinalVariableCandidateForAst(ast);
  }
  return result;
}

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

@Override
public Iterator<E> descendingIterator() {
 synchronized (mutex) {
  return delegate().descendingIterator();
 }
}

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

/** {@inheritDoc} */
  @NotNull @Override public Iterator<E> descendingIterator() {
    return new Iter(deque.descendingIterator());
  }
}

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

@Override
public Iterator<E> descendingIterator() {
 return delegate().descendingIterator();
}

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

/**
 * Creates a full package name from the package names on the stack.
 * @return the full name of the current package.
 */
private String getPackageName() {
  final StringBuilder buf = new StringBuilder(256);
  final Iterator<String> iterator = packageStack.descendingIterator();
  while (iterator.hasNext()) {
    final String subPackage = iterator.next();
    buf.append(subPackage);
    if (!CommonUtil.endsWithChar(subPackage, '.') && iterator.hasNext()) {
      buf.append('.');
    }
  }
  return buf.toString();
}

代码示例来源:origin: MovingBlocks/Terasology

private Rect2i findLastAtYPosition(Deque<Rect2i> floats, int y) {
    Iterator<Rect2i> iterator = floats.descendingIterator();
    while (iterator.hasNext()) {
      Rect2i rect = iterator.next();
      if (rect.minY() <= y && rect.maxY() > y) {
        return rect;
      }
    }
    return null;
  }
}

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

private void checkDeque(Deque<? extends E> deque, DescriptionBuilder builder) {
 builder.expectThat("empty deque", deque.peekFirst(), is(nullValue()));
 builder.expectThat("empty deque", deque.peekLast(), is(nullValue()));
 builder.expectThat("empty deque", deque.descendingIterator().hasNext(), is(false));
}

代码示例来源:origin: jankotek/mapdb

/**
 * iterator of empty collection has no elements
 */
public void testEmptyIterator() {
  Deque c = newDeque();
  assertIteratorExhausted(c.iterator());
  assertIteratorExhausted(c.descendingIterator());
}

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

create().push("e");
create().pop();
create().descendingIterator();

相关文章