本文整理了Java中java.util.Stack.forEach()
方法的一些代码示例,展示了Stack.forEach()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stack.forEach()
方法的具体详情如下:
包路径:java.util.Stack
类名称:Stack
方法名:forEach
暂无
代码示例来源:origin: com.pragmaticobjects.oo.atom/atom-basis
/**
* Put the traces of what was collected by the recorder to the stdout.
*/
public void trace() {
recordedCalls.forEach(System.out::println);
}
代码示例来源:origin: org.ballerinalang/ballerina-lang
private void attachAnnotations(AnnotatableNode annotatableNode) {
annotAttachmentStack.forEach(annotatableNode::addAnnotationAttachment);
annotAttachmentStack.clear();
}
代码示例来源:origin: io.github.therealmone/SPOParser
private static String convertToString() {
StringBuilder out = new StringBuilder();
stack.forEach(command ->
out.append(command).append(",")
);
out.deleteCharAt(out.length() - 1);
return out.toString();
}
}
代码示例来源:origin: org.ballerinalang/ballerina-lang
void startXMLElement(DiagnosticPos pos, Set<Whitespace> ws, boolean isRoot) {
BLangXMLElementLiteral xmlElement = (BLangXMLElementLiteral) TreeBuilder.createXMLElementLiteralNode();
BLangExpression startTag = (BLangExpression) exprNodeStack.pop();
xmlElement.addWS(ws);
xmlElement.startTagName = startTag;
xmlElement.pos = pos;
xmlElement.isRoot = isRoot;
xmlAttributeNodeStack.forEach(xmlElement::addAttribute);
xmlAttributeNodeStack.clear();
addExpressionNode(xmlElement);
}
代码示例来源:origin: asad/SMSD
S_copy = new ArrayList<>();
P.forEach((I) -> {
P_Prime.add(I);
});
});
P.forEach((obj) -> {
P_copy.add(obj);
});
D.forEach((obj) -> {
D_copy.add(obj);
});
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
/**
* Completes the current client request. It registers the composite command into the
* session's registry.
*/
private void complete() {
if (isRequestStarted()) {
final boolean hasCommands = !commands.isEmpty();
if (hasCommands && roolback) {
LOGGER.log(Level.FINEST,
"Performing rollback for commands in current requrest.");
final AbstractCanvasHandler canvasHandler = getCurrentSession().getCanvasHandler();
commands.forEach(c -> c.undo(canvasHandler));
} else if (hasCommands) {
// If any commands have been aggregated, let's composite them and add into the registry.
LOGGER.log(Level.FINEST,
"Adding commands for current request into registry [size=" + commands.size() + "]");
getRegistry().register(new CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation>()
.addCommands(commands.stream().collect(Collectors.toList()))
.build());
}
LOGGER.log(Level.FINEST,
"Current client request completed.");
} else {
LOGGER.log(Level.WARNING,
"Current client request has not been started.");
}
clear();
}
代码示例来源:origin: HuygensING/timbuctoo
private CreateProperty convertToProperty(PredicateInUse pred) {
Stack<ValueTypeInUse> valueTypes = pred.getValueTypes().stream()
.sorted(comparingInt(o -> o.getEntitiesConnected().size()))
.collect(toCollection(Stack::new));
ValueTypeInUse type = valueTypes.pop();
valueTypes.forEach(vt -> vt
.getEntitiesConnected().forEach(e -> importErrorReporter
.entityHasWrongTypeForProperty(e, pred.getPredicateUri(), type.getTypeUri(), vt.getTypeUri())
)
);
return ImmutableCreateProperty.builder()
.clientName(getPredicateName(pred))
.rdfUri(pred.getPredicateUri())
.typeUri(type.getTypeUri())
.propertyType(getPropertyType(pred.getPredicateUri(), type))
.build();
}
内容来源于网络,如有侵权,请联系作者删除!