本文整理汇总了C#中Map.entrySet方法的典型用法代码示例。如果您正苦于以下问题:C# Map.entrySet方法的具体用法?C# Map.entrySet怎么用?C# Map.entrySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map.entrySet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RoomConfiguration
/**
* Creates a new IQ packet that contains the field and values to send for setting the room
* configuration.
*
* @param fieldValues the list of fields associated with the list of values.
*/
public RoomConfiguration(Map<String,Collection<String>> fieldValues) {
super();
setType(Type.set);
Element query = setChildElement("query", "http://jabber.org/protocol/muc#owner");
Element form = query.addElement("x", "jabber:x:data");
form.addAttribute("type", "submit");
// Add static field
Element field = form.addElement("field");
field.addAttribute("var", "FORM_TYPE");
field.addElement("value").setText("http://jabber.org/protocol/muc#roomconfig");
// Add the specified fields and their corresponding values
for (Entry<String, Collection<String>> entry : fieldValues.entrySet()) {
field = form.addElement("field");
field.addAttribute("var", entry.getKey());
for (String value : entry.getValue()) {
field.addElement("value").setText(value);
}
}
}
示例2: putAll
public void putAll(Map m)
{
Iterator i = m.entrySet().iterator();
while (i.hasNext())
{
MapEntry e = (MapEntry)i.next();
put(e.getKey(), e.getValue());
}
}
示例3: putAll
public override void putAll (Map t) {
for (Iterator it = t.entrySet ().iterator (); it.hasNext (); ) {
Map.Entry entry = (Map.Entry) it.next ();
setAttribute (entry.getKey ().ToString (), entry.getValue ());
}
}