Enovia中的hashMap取值操作

	if(!"".equals(newId) && null!=newId){
				DomainObject domObj = DomainObject.newInstance(context,projectId);
				MapList exitModelList = domObj.getRelatedObjects(context,"STN Related Model","Model", new StringList("id"), new StringList("id[connection]"),false,true,(short)1, null, null);
				Map<String,String> exitModelIdList=new HashMap<String,String>();
				if(exitModelList.size()>0)
				{
					Iterator it = exitModelList.iterator();
					while(it.hasNext()){
						Map map = (Map)it.next();
						String id=(String)map.get("id");
						//exitModelIdList.put("id",id);
						//if(!newIds.contains(id)){
							String rid=(String)map.get("id[connection]");
							DomainRelationship.disconnect(context,rid);
						//}
					}
				}
				for(int i = 0;i<newIds.length;i++){
					//domObj.setAttributeValue(context, "STN Machine Model", newIds[i]);
					RelationshipType relType = new RelationshipType("STN Related Model");
					//if(!exitModelIdList.containsValue(newIds[i]))
					domObj.addToObject(context, relType, newIds[i]);	
				}					
			}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章