org.jvnet.hk2.component.MultiMap.remove()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(96)

本文整理了Java中org.jvnet.hk2.component.MultiMap.remove()方法的一些代码示例,展示了MultiMap.remove()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MultiMap.remove()方法的具体详情如下:
包路径:org.jvnet.hk2.component.MultiMap
类名称:MultiMap
方法名:remove

MultiMap.remove介绍

[英]Removes an key value from the map
[中]从映射中删除键值

代码示例

代码示例来源:origin: javaee/glassfish

static String innerSort(String line) {
 MultiMap<String, String> mm = split(line);
 StringBuilder sb = new StringBuilder();
 // class
 List<String> vals = mm.remove("class");
 assert(null != vals && 1 == vals.size());
 sb.append("class=").append(vals.iterator().next());
 
 // indicies
 vals = mm.remove("index");
 if (null != vals && vals.size() > 0) {
  Collections.sort(vals);
  for (String index : vals) {
   sb.append(",index=").append(index);
  }
 }
 
 // metadata
 vals = new ArrayList<String>(mm.keySet());
 Collections.sort(vals);
 for (String key : vals) {
  List<String> subVals = new ArrayList<String>(mm.get(key));
  Collections.sort(subVals);
  for (String val : subVals) {
   sb.append(",").append(key).append("=").append(val);
  }
 }
 return sb.toString();
}

代码示例来源:origin: eclipse-ee4j/glassfish

static String innerSort(String line) {
 MultiMap<String, String> mm = split(line);
 StringBuilder sb = new StringBuilder();
 // class
 List<String> vals = mm.remove("class");
 assert(null != vals && 1 == vals.size());
 sb.append("class=").append(vals.iterator().next());
 
 // indicies
 vals = mm.remove("index");
 if (null != vals && vals.size() > 0) {
  Collections.sort(vals);
  for (String index : vals) {
   sb.append(",index=").append(index);
  }
 }
 
 // metadata
 vals = new ArrayList<String>(mm.keySet());
 Collections.sort(vals);
 for (String key : vals) {
  List<String> subVals = new ArrayList<String>(mm.get(key));
  Collections.sort(subVals);
  for (String val : subVals) {
   sb.append(",").append(key).append("=").append(val);
  }
 }
 return sb.toString();
}

代码示例来源:origin: org.glassfish.hk2/auto-depends

/**
 * Removes an inhabitant
 *
 * @param inhabitant inhabitant to be removed
 */
public boolean remove(Inhabitant<?> inhabitant) {
  String name = inhabitant.typeName();
  if (byType.remove(name, inhabitant)) {
    notify(inhabitant, EventType.INHABITANT_REMOVED, null, null);
    inhabitant.release();
    return true;
  }
  return false;
}

代码示例来源:origin: com.sun.enterprise/auto-depends

/**
 * Removes an inhabitant
 *
 * @param inhabitant inhabitant to be removed
 */
public boolean remove(Inhabitant<?> inhabitant) {
  String name = inhabitant.typeName();
  if (byType.remove(name, inhabitant)) {
    notify(inhabitant, EventType.INHABITANT_REMOVED, null, null);
    inhabitant.release();
    return true;
  }
  return false;
}

相关文章