當前位置: 首頁>>代碼示例>>Java>>正文


Java SortedMap.forEach方法代碼示例

本文整理匯總了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));
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:17,代碼來源:FlowsListCommand.java

示例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();
}
 
開發者ID:xstefank,項目名稱:lra-service,代碼行數:13,代碼來源:LRARecord.java

示例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));
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:14,代碼來源:GroupsListCommand.java

示例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));
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:15,代碼來源:TableStatisticsCommand.java


注:本文中的java.util.SortedMap.forEach方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。