Java List Create createConsultInfoMap(List resAry)

Here you can find the source of createConsultInfoMap(List resAry)

Description

create Consult Info Map

License

Apache License

Declaration

public static Map<String, Map<String, String>> createConsultInfoMap(List<String> resAry) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class Main {
    public static Map<String, Map<String, String>> createConsultInfoMap(List<String> resAry) {

        Iterator<String> iter = resAry.iterator();
        iter.next(); // skip ~ShortList
        iter.next(); // skip ~Inpt Cslt Urgencies

        Map<String, Map<String, String>> resMap = new HashMap<String, Map<String, String>>();

        resMap.put("inpatient_urgencies", createMap(iter));
        resMap.put("outpatient_urgencies", createMap(iter));
        resMap.put("inpatient_places", createMap(iter));
        resMap.put("outpatient_places", createMap(iter));

        return resMap;
    }/*  w  w w.j  av a2 s .c  o  m*/

    private static Map<String, String> createMap(Iterator<String> iter) {

        boolean finished = false;
        Map<String, String> m = new HashMap<String, String>();
        while (iter.hasNext() && !finished) {
            String row = iter.next();
            if (row.startsWith("~")) {
                finished = true;
            } else {
                String[] tokens = row.split("\\^");
                m.put(tokens[1].trim(), tokens[0].substring(1).trim());
            }
        }
        return m;
    }
}

Related

  1. createColumnsToken(List columnnames)
  2. createCommaList(List values, int rowCharacterCount)
  3. createCommand(LinkedList> list)
  4. createConflictMessage(List conflicts)
  5. createConfusionMatrix(HashMap> tempM, List actualLabelsList, List predictedLabelsList)
  6. createCSVLine(final char textQ, final char fieldD, final List values)
  7. createDefaultGroup(String name, String prefabGroup, List nodes)
  8. createDefaultValueList(int capacity, T defaultValue)
  9. createDelimitedString(String rawListAsString)

  10. HOME | Copyright © www.java2s.com 2016