project 思考
https://dotblogs.com.tw/kent2480/2014/01/10/139465
public class Main{
public static void main(String[] args){
Map<String, String>
用for 迴圈把 waferID 拿出來後, 放到waferComMap 內
4.拿資料比對
//將Data 塞入
for (Map<String, String> m : waferComLst)
{
m.get(waferID,group); //waferID 內值是string. ex:NRN111.01,CCRTT.02
}
//整合group to waferList data
for (String k : m.keySet())
{
System.out.println(k + " : " + m.get(k));
if(k == vo.getWaferId)
{
vo.setGroup(m.get(k))
}
}
5.
groupLst
Map<String,List<String>> groupLst = new HashMap<String,List<String>>();
if( groupLst!=null && groupLst.size()>0) {
Iterator<Map.Entry<String, List<String>>> it = groupLst .entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String,List<String>> entry=it.next();
System.out.println("key="+entry.getKey()+","+"value="+entry.getValue());
if(vo.getGroup = entry.getKey()){
// List<string, string> cond = (List<string, string>) entry.getValue();
for(int i = 0; i < entry.getValue().size(); i++) {
//String conStr = entry.getValue().get(i);
String cond1 =entry.getValue().get(1);
vo.setCond1 (cond1 );
String cond2 =entry.getValue().get(2);
vo.setCond2 (cond2 );
String cond3 =entry.getValue().get(3);
vo.setCond3 (cond3 );
String cond4 =entry.getValue().get(4);
vo.setCond4 (cond4);
String cond5 =entry.getValue().get(5);
vo.setCond4 (cond5);
} }
}
}
https://openhome.cc/Gossip/Java/List.html
https://www.itread01.com/content/1541179990.html
https://www.itread01.com/content/1550247671.html
原文链接:https://blog.csdn.net/fengzhimohan/article/details/79038480
https://stackoverflow.com/questions/10928004/how-to-achieve-this-mapstring-list-structure
=========
static void printUpperCase(List<String> names) {
for(int i = 0; i < names.size(); i++) {
String name = names.get(i);
out.println(name.toUpperCase());
}
} Map<String, List<String>> myMaps = new HashMap<String, List<String>>();
for (DataObject item : myList) {
if (!myMaps.containsKey(item.getKey())) {
myMaps.put(item.getKey(), new ArrayList<String>());
}
myMaps.get(item.getKey()).add(item.getValue());
}Map<String,Object> testMap = new HashMap<String, String>();
testMap.put("1", "test1");
testMap.put("2", "test2");
List<Map<String, String>> list = new ArrayList<Map<String, String>>();
list.add(testMap);
for (Map<String, String> m : list)
{
for (String k : m.keySet())
{
System.out.println(k + " : " + m.get(k));
}
}
Java Map通过值来获取键的正确姿势
https://blog.csdn.net/w605283073/article/details/85054373
https://blog.csdn.net/weixin_39648430/article/details/114057607
https://blog.csdn.net/zsp151296/article/details/76714151
留言
張貼留言