org.apache.commons.collections.MultiMap.remove()方法的使用及代码示例

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

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

MultiMap.remove介绍

[英]Removes all values associated with the specified key.

Implementations typically return null from a subsequant get(Object), however they may choose to return an empty collection.
[中]删除与指定键关联的所有值。
实现通常从子数量get(Object)返回null,但它们可能会选择返回空集合。

代码示例

代码示例来源:origin: apache/flume

} else if (type == TransactionEventRecord.Type.ROLLBACK.get()) {
 rollbackCount++;
 transactionMap.remove(trans);
} else if (type == TransactionEventRecord.Type.COMMIT.get()) {
 commitCount++;
 @SuppressWarnings("unchecked")
 Collection<FlumeEventPointer> pointers =
   (Collection<FlumeEventPointer>) transactionMap.remove(trans);
 if (((Commit) record).getType() == TransactionEventRecord.Type.TAKE.get()) {
  if (inflightTakes.containsKey(trans)) {

代码示例来源:origin: apache/flume

} else if (type == TransactionEventRecord.Type.ROLLBACK.get()) {
 rollbackCount++;
 transactionMap.remove(trans);
} else if (type == TransactionEventRecord.Type.COMMIT.get()) {
 commitCount++;
 @SuppressWarnings("unchecked")
 Collection<FlumeEventPointer> pointers =
   (Collection<FlumeEventPointer>) transactionMap.remove(trans);
 if (((Commit) record).getType()
     == TransactionEventRecord.Type.TAKE.get()) {

代码示例来源:origin: org.jvnet.jaxbvalidation/jaxbvalidation-shared

public void unregisterValidationEventHandler(final ValidationEventLocator locator, final ValidationEventHandler handler)
{
 handlersMap.remove(locator, handler);
}

代码示例来源:origin: org.jsmiparser/jsmiparser-util

public Collection<V> remove(K key) {
  return (Collection<V>) m_impl.remove(key);
}

代码示例来源:origin: com.atlassian.jira/jira-api

/**
 * Associates issue types to custom fields.  This should be called after the parse of all entities is done to give
 * all the custom field values (there may be more than just <CustomFieldValue> entities) a chance to register
 * themselves.
 */
public void registerIssueTypesInUse()
{
  for (String oldIssueId : issueToIssueTypeCache.keySet())
  {
    // Find all the customFields associated with this issue
    // We remove the values as we go because we know we will only need them once, and we want to free up memory.
    final Collection customFields = (Collection) issueToCustomFieldMap.remove(oldIssueId);
    if (customFields != null)
    {
      for (final Object customField : customFields)
      {
        final String customFieldId = (String) customField;
        // register that this custom field uses the given issue type.
        final String oldIssueTypeId = issueToIssueTypeCache.get(oldIssueId);
        issueTypesInUse.put(customFieldId, oldIssueTypeId);
        // Also store a map to remember the Issue Type for each Issue.
        issueToIssueTypeMap.put(oldIssueId, oldIssueTypeId);
      }
    }
  }
  //clear the cache...it's no longer needed now!
  issueToIssueTypeCache.clear();
}

代码示例来源:origin: info.magnolia/magnolia-module-cache

private void replaceHeader(String name, Object value) {
  if (responseExpirationCalculator == null || !responseExpirationCalculator.addHeader(name, value)) {
    headers.remove(name);
    headers.put(name, value);
  }
}

代码示例来源:origin: org.apache.cocoon/cocoon-expression-language-impl

private void removeAt(String path, Object value) {
  if (path == null) {
    throw new NullPointerException("Path cannot be null.");
  }
  if (path.length() == 0) {
    throw new IllegalArgumentException("Path cannot be empty");
  }
  Map map = locateMapAt(path, false);
  String key = path.substring(path.lastIndexOf(SEGMENT_SEPARATOR) + 1, path.length());
  if (map == null) {
    return;
  }
  multiValueMapForLocated.remove(key, value);
  if (multiValueMap.containsKey(key)) {
    map.put(key, ((StackReversedIteration) multiValueMap.get(key)).peek());
  } else {
    map.remove(key);
  }
}

代码示例来源:origin: org.integratedmodelling/klab-common

public static void removeRolesFor(INamespace namespace) {
  List<Pair<IConcept, RoleDescriptor>> toRemove = new ArrayList<>();
  for (Object o : roles.values()) {
    RoleDescriptor rd = (RoleDescriptor) o;
    if (rd.namespaceId.equals(namespace.getId())) {
      toRemove.add(new Pair<>(rd.role, rd));
    }
  }
  for (Pair<IConcept, RoleDescriptor> r : toRemove) {
    roles.remove(r.getFirst(), r.getSecond());
  }
}

代码示例来源:origin: com.atlassian.jira.plugin.labels/jira-labels-plugin

List currentBucketContents = (List) alphabetBuckets.remove(currentKey + "");
  lastBucketContents = (List) alphabetBuckets.remove(lastBucketKey);

代码示例来源:origin: andyczy/czy-study-java-commons-utils

multiMap.put( "Sean" , "Java" );
multiMap.put( "Sean" , ".NET" );
multiMap.remove( "Sean" , "C/C++" );

代码示例来源:origin: org.apache.cocoon/cocoon-expression-language-impl

public void cleanupLocalContext() {
  if (localContexts.empty()) {
    throw new IllegalStateException("Local contexts stack is empty");
  }
  ArrayStack removeEntries = (ArrayStack)localContexts.pop();
  while (!removeEntries.isEmpty()) {
    if (removeEntries.peek() instanceof PathValue) {
      PathValue entry = (PathValue)removeEntries.pop();
      removeAt(entry.getPath(), entry.getValue());
    } else {
      KeyValue entry = (KeyValue)removeEntries.pop();
      Object key = entry.getKey();
      Object value = entry.getValue();
      multiValueMap.remove(key, value);
      if (multiValueMap.containsKey(key)) {
        singleValueMap.put(key, ((StackReversedIteration) multiValueMap.get(key)).peek());
      } else {
        singleValueMap.remove(key);
      }
    }
  }
}

代码示例来源:origin: org.apache.flume.flume-ng-channels/flume-file-channel

} else if (type == TransactionEventRecord.Type.ROLLBACK.get()) {
 rollbackCount++;
 transactionMap.remove(trans);
} else if (type == TransactionEventRecord.Type.COMMIT.get()) {
 commitCount++;
 @SuppressWarnings("unchecked")
 Collection<FlumeEventPointer> pointers =
   (Collection<FlumeEventPointer>) transactionMap.remove(trans);
 if (((Commit) record).getType() == TransactionEventRecord.Type.TAKE.get()) {
  if (inflightTakes.containsKey(trans)) {

代码示例来源:origin: org.apache.flume.flume-ng-channels/flume-file-channel

} else if (type == TransactionEventRecord.Type.ROLLBACK.get()) {
 rollbackCount++;
 transactionMap.remove(trans);
} else if (type == TransactionEventRecord.Type.COMMIT.get()) {
 commitCount++;
 @SuppressWarnings("unchecked")
 Collection<FlumeEventPointer> pointers =
   (Collection<FlumeEventPointer>) transactionMap.remove(trans);
 if (((Commit) record).getType()
     == TransactionEventRecord.Type.TAKE.get()) {

相关文章