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

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

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

Deque.getLast介绍

[英]Retrieves, but does not remove, the last element of this deque. This method differs from #peekLast only in that it throws an exception if this deque is empty.
[中]检索但不删除此数据块的最后一个元素。此方法与#peek last的不同之处在于,如果此deque为空,则会引发异常。

代码示例

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

@Override
public E getLast() {
 synchronized (mutex) {
  return delegate().getLast();
 }
}

代码示例来源:origin: square/moshi

/** Sets the adapter result of the current lookup. */
<T> void adapterFound(JsonAdapter<T> result) {
 Lookup<T> currentLookup = (Lookup<T>) stack.getLast();
 currentLookup.adapter = result;
}

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

@Override
public synchronized V getLast() {
  return delegate.getLast();
}

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

@Override
public E getLast() {
 synchronized (mutex) {
  return delegate().getLast();
 }
}

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

@Override
public E getLast() {
 return delegate().getLast();
}

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

@Override
public E getLast() {
 synchronized (mutex) {
  return delegate().getLast();
 }
}

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

@Override
public E getLast() {
 return delegate().getLast();
}

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

public Object value()
{
  assert stack.size() == 1;
  return stack.getLast().value();
}

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

public String value()
{
  assert stack.size() == 1;
  return stack.getLast().done();
}

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

public Object value()
{
  assert stack.size() == 1;
  return stack.getLast().value();
}

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

@Override
public E getLast() {
 assertTrue(Thread.holdsLock(mutex));
 return delegate.getLast();
}

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

@Override
public E getLast() {
 return delegate().getLast();
}

代码示例来源:origin: SonarSource/sonarqube

@Override
public T root() {
 return deque.getLast().getElement();
}

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

synchronized void setStateChangeLister(StateChangeLister stateChangeLister) {
  this.stateChangeLister = stateChangeLister;
  if (!data.isEmpty() && data.getLast() == EOF) {
    stateChangeLister.onAllDataRead();
  }
  if (!data.isEmpty() && data.getLast() == ERROR) {
    stateChangeLister.onError(t);
  }
}

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

/**
 * Returns the size in MB from the most recent RegionLoad for region
 */
public int getRegionSizeMB(int region) {
 Deque<BalancerRegionLoad> load = regionLoads[region];
 // This means regions have no actual data on disk
 if (load == null) {
  return 0;
 }
 return regionLoads[region].getLast().getStorefileSizeMB();
}

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

@Override
public E getLast() {
 synchronized (mutex) {
  return delegate().getLast();
 }
}

代码示例来源:origin: hs-web/hsweb-framework

@Override
public String currentDataSourceId() {
  if (getUsedHistoryQueue().isEmpty()) {
    return null;
  }
  String activeId = getUsedHistoryQueue().getLast();
  if (DEFAULT_DATASOURCE_ID.equals(activeId)) {
    return null;
  }
  return activeId;
}

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

@Override
public void visitToken(DetailAST ast) {
  if (isOverridingMethod(ast)) {
    methodStack.add(new MethodNode(ast));
  }
  else if (isSuperCall(ast)) {
    final MethodNode methodNode = methodStack.getLast();
    methodNode.setCallingSuper();
  }
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Eat an identifier, possibly qualified (meaning that it is dotted).
 * TODO AndyC Could create complete identifiers (a.b.c) here rather than a sequence of them? (a, b, c)
 */
private SpelNodeImpl eatPossiblyQualifiedId() {
  Deque<SpelNodeImpl> qualifiedIdPieces = new ArrayDeque<>();
  Token node = peekToken();
  while (isValidQualifiedId(node)) {
    nextToken();
    if (node.kind != TokenKind.DOT) {
      qualifiedIdPieces.add(new Identifier(node.stringValue(), node.startPos, node.endPos));
    }
    node = peekToken();
  }
  if (qualifiedIdPieces.isEmpty()) {
    if (node == null) {
      throw internalException( this.expressionString.length(), SpelMessage.OOD);
    }
    throw internalException(node.startPos, SpelMessage.NOT_EXPECTED_TOKEN,
        "qualified ID", node.getKind().toString().toLowerCase());
  }
  return new QualifiedIdentifier(qualifiedIdPieces.getFirst().getStartPosition(),
      qualifiedIdPieces.getLast().getEndPosition(), qualifiedIdPieces.toArray(new SpelNodeImpl[0]));
}

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

create().pollLast();
create().getFirst();
create().getLast();
create().peekFirst();
create().peekLast();

相关文章