本文整理了Java中java.util.LinkedList.forEach()
方法的一些代码示例,展示了LinkedList.forEach()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LinkedList.forEach()
方法的具体详情如下:
包路径:java.util.LinkedList
类名称:LinkedList
方法名:forEach
暂无
代码示例来源:origin: hibernate/hibernate-orm
@Override
public void visitCurrentFirst(Consumer<T> action) {
internalStack.forEach( action );
}
代码示例来源:origin: oracle/helidon
void addAll(MapperProviders other) {
LinkedList<Function<GenericType<?>,
Optional<? extends BiFunction<Config, ConfigMapper, ?>>>> otherProviders = new LinkedList<>(other.providers);
Collections.reverse(otherProviders);
otherProviders
.forEach(this::add);
}
代码示例来源:origin: ethereum/ethereumj
index.remove(randomNum);
index.forEach(i -> truncated.add(items.get(i)));
代码示例来源:origin: neo4j/neo4j
runningMachines.forEach( BoltStateMachine::close );
代码示例来源:origin: eclipse-vertx/vert.x
assertEquals("", content.substring(idx + 4));
MultiMap respHeaders = MultiMap.caseInsensitiveMultiMap();
records.forEach(record -> {
int index = record.indexOf(":");
String value = record.substring(0, index);
代码示例来源:origin: apache/geode
value.forEach(internalPdxInstance -> {
ArrayList innerObject = new ArrayList();
((PdxInstance) internalPdxInstance).getFieldNames()
代码示例来源:origin: speedment/speedment
instances.forEach(instance -> traverseFields(instance.getClass())
.filter(f -> f.isAnnotationPresent(Inject.class))
.distinct()
代码示例来源:origin: hyperledger/fabric-sdk-java
entries.forEach(queEntry -> {
代码示例来源:origin: DV8FromTheWorld/JDA
@Override
protected void handleResponse(Response response, Request<List<Message>> request)
{
if (!response.isOk())
{
request.onFailure(response);
return;
}
EntityBuilder builder = api.get().getEntityBuilder();
LinkedList<Message> msgs = new LinkedList<>();
JSONArray historyJson = response.getArray();
for (int i = 0; i < historyJson.length(); i++)
msgs.add(builder.createMessage(historyJson.getJSONObject(i)));
msgs.forEach(msg -> history.put(msg.getIdLong(), msg));
request.onSuccess(msgs);
}
};
代码示例来源:origin: io.vertx/vertx-core
assertEquals("", content.substring(idx + 4));
MultiMap respHeaders = MultiMap.caseInsensitiveMultiMap();
records.forEach(record -> {
int index = record.indexOf(":");
String value = record.substring(0, index);
代码示例来源:origin: de.mhus.lib/mhu-lib-core
private AbstractList<E> toList() {
final LinkedList<E> out = new LinkedList<>();
items.forEach(i -> {E v = i.get(); if (v != null) out.add(v);});
return out;
}
代码示例来源:origin: io.virtdata/metagen-lib-composer
private String summarize(LinkedList<List<ResolvedFunction>> funcs) {
List<List<String>> spans = new LinkedList<>();
funcs.forEach(l -> spans.add(l.stream().map(String::valueOf).collect(Collectors.toList())));
List<Optional<Integer>> widths = spans.stream().map(
l -> l.stream().map(String::length).max(Integer::compare)).collect(Collectors.toList());
String summary = spans.stream().map(
l -> l.stream().map(String::valueOf).collect(Collectors.joining("|\n"))
).collect(Collectors.joining("\n"));
return summary;
}
代码示例来源:origin: jcbvm/i18n-editor
private void removeChildren(String key) {
Lists.newLinkedList(translations.keySet()).forEach(k -> {
if (ResourceKeys.isChildKeyOf(k, key)) {
translations.remove(k);
}
});
}
代码示例来源:origin: com.g2forge.alexandria/ax-java
public static void delete(Path path) throws IOException {
final LinkedList<Path> onexit = new LinkedList<>();
Files.walkFileTree(path, new DirectoryTreeDeleteVisitor(onexit));
onexit.forEach(toDelete -> toDelete.toFile().deleteOnExit());
}
代码示例来源:origin: RS485/LogisticsPipes
private void shutdownCleanup() {
taskQueue = null;
scheduledTaskList.forEach(tickScheduledTask -> tickScheduledTask.cancel(false));
scheduledTaskList = null;
terminationFuture.complete(null);
}
代码示例来源:origin: jcbvm/i18n-editor
private void removeParents(String key) {
Lists.newLinkedList(translations.keySet()).forEach(k -> {
if (ResourceKeys.isChildKeyOf(key, k)) {
translations.remove(k);
}
});
}
代码示例来源:origin: javers/javers
private LinkedList<CdoSnapshot> readSnapshots(String globalIdValue) {
LinkedList<CdoSnapshot> result = new LinkedList<>();
if (!contains(globalIdValue)) {
return result;
}
snapshots.get(globalIdValue).forEach(it -> result.add(jsonConverter.fromJson(it, CdoSnapshot.class)));
return result;
}
代码示例来源:origin: org.ballerinalang/ballerina-lang
@Override
public Map<String, BLangMarkdownParameterDocumentation> getParameterDocumentations() {
Map<String, BLangMarkdownParameterDocumentation> parameterDocumentations = new HashMap<>();
parameters.forEach(p -> parameterDocumentations.put(p.getParameterName().getValue(), p));
return parameterDocumentations;
}
代码示例来源:origin: org.ballerinalang/ballerina-lang
private void visitIterableOperationInvocation(BLangInvocation iExpr) {
IterableContext iContext = iExpr.iContext;
if (iContext.operations.getLast().iExpr != iExpr) {
result = null;
return;
}
iContext.operations.forEach(operation -> rewrite(operation.iExpr.argExprs, env));
iterableCodeDesugar.desugar(iContext);
result = rewriteExpr(iContext.iteratorCaller);
}
代码示例来源:origin: com.google.guava/guava-tests
@Benchmark
int linkedListForEach(int reps) {
int[] sumHolder = {0};
for (int i = 0; i < reps; i++) {
linkedList.forEach(value -> sumHolder[0] += value.hashCode());
}
return sumHolder[0];
}
内容来源于网络,如有侵权,请联系作者删除!