本文整理匯總了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));
}
}