本文整理了Java中java.util.Deque.element()
方法的一些代码示例,展示了Deque.element()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Deque.element()
方法的具体详情如下:
包路径:java.util.Deque
类名称:Deque
方法名:element
[英]Retrieves, but does not remove, the head of the queue represented by this deque (in other words, the first element of this deque). This method differs from #peek only in that it throws an exception if this deque is empty.
This method is equivalent to #getFirst().
[中]检索但不删除此deque表示的队列头(换句话说,此deque的第一个元素)。此方法与#peek的不同之处在于,如果此deque为空,则会引发异常。
此方法相当于#getFirst()。
代码示例来源:origin: spring-projects/spring-framework
private TagStateEntry currentState() {
return this.tagState.element();
}
代码示例来源:origin: spring-projects/spring-framework
/**
* The active context object is what unqualified references to properties/etc are resolved against.
*/
public TypedValue getActiveContextObject() {
if (CollectionUtils.isEmpty(this.contextObjects)) {
return this.rootObject;
}
return this.contextObjects.element();
}
代码示例来源:origin: spring-projects/spring-framework
/**
* Record the descriptor for the most recently evaluated expression element.
* @param descriptor type descriptor for most recently evaluated element
*/
public void pushDescriptor(@Nullable String descriptor) {
if (descriptor != null) {
this.compilationScopes.element().add(descriptor);
}
}
代码示例来源:origin: btraceio/btrace
@Override
public synchronized V element() {
return delegate.element();
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public E element() {
return deque.element();
}
代码示例来源:origin: org.springframework/spring-webmvc
private TagStateEntry currentState() {
return this.tagState.element();
}
代码示例来源:origin: org.springframework/spring-expression
/**
* The active context object is what unqualified references to properties/etc are resolved against.
*/
public TypedValue getActiveContextObject() {
if (CollectionUtils.isEmpty(this.contextObjects)) {
return this.rootObject;
}
return this.contextObjects.element();
}
代码示例来源:origin: org.springframework/spring-expression
/**
* Record the descriptor for the most recently evaluated expression element.
* @param descriptor type descriptor for most recently evaluated element
*/
public void pushDescriptor(@Nullable String descriptor) {
if (descriptor != null) {
this.compilationScopes.element().add(descriptor);
}
}
代码示例来源:origin: google/guava
@Override
public E element() {
assertTrue(Thread.holdsLock(mutex));
return delegate.element();
}
代码示例来源:origin: spring-projects/spring-framework
public void setLocalVariable(String name, Object value) {
initVariableScopes().element().setVariable(name, value);
}
代码示例来源:origin: spring-projects/spring-framework
public CircularImportProblem(ConfigurationClass attemptedImport, Deque<ConfigurationClass> importStack) {
super(String.format("A circular @Import has been detected: " +
"Illegal attempt by @Configuration class '%s' to import class '%s' as '%s' is " +
"already present in the current import stack %s", importStack.element().getSimpleName(),
attemptedImport.getSimpleName(), attemptedImport.getSimpleName(), importStack),
new Location(importStack.element().getResource(), attemptedImport.getMetadata()));
}
}
代码示例来源:origin: org.springframework/spring-context
public CircularImportProblem(ConfigurationClass attemptedImport, Deque<ConfigurationClass> importStack) {
super(String.format("A circular @Import has been detected: " +
"Illegal attempt by @Configuration class '%s' to import class '%s' as '%s' is " +
"already present in the current import stack %s", importStack.element().getSimpleName(),
attemptedImport.getSimpleName(), attemptedImport.getSimpleName(), importStack),
new Location(importStack.element().getResource(), attemptedImport.getMetadata()));
}
}
代码示例来源:origin: org.springframework/spring-expression
public void setLocalVariable(String name, Object value) {
initVariableScopes().element().setVariable(name, value);
}
代码示例来源:origin: google/guava
public void testHoldsLockOnAllOperations() {
create().element();
create().offer("foo");
create().peek();
代码示例来源:origin: com.aol.cyclops/cyclops-core
/**
* @return
* @see java.util.Deque#element()
*/
public T element() {
return deque.element();
}
/**
代码示例来源:origin: com.google.javascript/closure-compiler
/**
* Determines whether assignment to a define should be allowed
* at the current point of the traversal.
*/
private boolean isAssignAllowed() {
return assignAllowed.element() == 1;
}
代码示例来源:origin: org.scala-js/closure-compiler-java-6
/**
* Determines whether assignment to a define should be allowed
* at the current point of the traversal.
*/
private boolean isAssignAllowed() {
return assignAllowed.element() == 1;
}
代码示例来源:origin: de.svenkubiak/mangooio-core
private Map<String, String> getRequestParameters(HttpServerExchange exchange) {
Map<String, String> requestParamater = new HashMap<String, String>();
Map<String, Deque<String>> queryParameters = exchange.getQueryParameters();
queryParameters.putAll(exchange.getPathParameters());
for (Map.Entry<String, Deque<String>> entry : queryParameters.entrySet()) {
requestParamater.put(entry.getKey(), entry.getValue().element());
}
return requestParamater;
}
代码示例来源:origin: com.google.guava/guava-tests
@Override
public E element() {
assertTrue(Thread.holdsLock(mutex));
return delegate.element();
}
代码示例来源:origin: bozaro/git-as-svn
@Override
public void openDir(@NotNull String name) throws SVNException, IOException {
final GitTreeUpdate current = treeStack.element();
final GitTreeEntry originalDir = current.getEntries().remove(name);
if ((originalDir == null) || (!originalDir.getFileMode().equals(FileMode.TREE))) {
throw new SVNException(SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND, getFullPath(name)));
}
commitActions.add(action -> action.openDir(name));
treeStack.push(new GitTreeUpdate(name, repo.loadTree(originalDir)));
}
内容来源于网络,如有侵权,请联系作者删除!