本文整理汇总了Java中java.util.SortedMap.forEach方法的典型用法代码示例。如果您正苦于以下问题:Java SortedMap.forEach方法的具体用法?Java SortedMap.forEach怎么用?Java SortedMap.forEach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.SortedMap
的用法示例。
在下文中一共展示了SortedMap.forEach方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: assignmentsToTable
import java.util.SortedMap; //导入方法依赖的package包/类
public static Table<String, String, String> assignmentsToTable(
SortedMap<String, SortedSet<SingleWorkerAssignment<Step2bGoldReasonAnnotator.SentenceLabel>>> assignments)
{
TreeBasedTable<String, String, String> result = TreeBasedTable.create();
assignments.forEach((unitID, singleWorkerAssignments) -> {
singleWorkerAssignments.forEach(sentenceLabelSingleWorkerAssignment -> {
String workerID = sentenceLabelSingleWorkerAssignment.getWorkerID();
String label = sentenceLabelSingleWorkerAssignment.getLabel().toString();
// update the table
result.put(unitID, workerID, label);
});
});
return result;
}
开发者ID:UKPLab,项目名称:argument-reasoning-comprehension-task,代码行数:18,代码来源:Step2dExportReasonSpanAnnotationPilot.java
示例2: execute
import java.util.SortedMap; //导入方法依赖的package包/类
@Override
protected void execute() {
CoreService coreService = get(CoreService.class);
DeviceService deviceService = get(DeviceService.class);
FlowRuleService service = get(FlowRuleService.class);
compilePredicate();
SortedMap<Device, List<FlowEntry>> flows = getSortedFlows(deviceService, service, coreService);
if (outputJson()) {
print("%s", json(flows.keySet(), flows));
} else {
flows.forEach((device, flow) -> printFlows(device, flow, coreService));
}
}
示例3: cannonicalForm
import java.util.SortedMap; //导入方法依赖的package包/类
private static String cannonicalForm(String linkStr) {
if (linkStr.indexOf(',') == -1)
return linkStr;
SortedMap<String, String> lm = new TreeMap<>();
Arrays.stream(linkStr.split(",")).forEach(link -> lm.put(Link.valueOf(link).getRel(), link));
StringBuilder sb = new StringBuilder();
lm.forEach((k, v) -> appendLink(sb, v));
return sb.toString();
}
示例4: execute
import java.util.SortedMap; //导入方法依赖的package包/类
@Override
protected void execute() {
DeviceService deviceService = get(DeviceService.class);
GroupService groupService = get(GroupService.class);
SortedMap<Device, List<Group>> sortedGroups =
getSortedGroups(deviceService, groupService);
if (outputJson()) {
print("%s", json(sortedGroups));
} else {
sortedGroups.forEach((device, groups) -> printGroups(device.id(), groups));
}
}
示例5: execute
import java.util.SortedMap; //导入方法依赖的package包/类
@Override
protected void execute() {
FlowRuleService flowService = get(FlowRuleService.class);
DeviceService deviceService = get(DeviceService.class);
SortedMap<Device, List<TableStatisticsEntry>> deviceTableStats =
getSortedTableStats(deviceService, flowService);
if (outputJson()) {
print("%s", json(deviceTableStats.keySet(), deviceTableStats));
} else {
deviceTableStats.forEach((device, tableStats) -> printTableStats(device, tableStats));
}
}