Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.errai.enterprise.client.cdi;
 
 import java.util.Map;
 
 import static java.util.Collections.unmodifiableMap;

Author(s):
Mike Brock
public final class CDIEventTypeLookup {
  private CDIEventTypeLookup() {
  }
  private final static CDIEventTypeLookup typeLookupSingleton = new CDIEventTypeLookup();
  public static CDIEventTypeLookup get() {
    return ;
  }

  
Returns a defensively copied, unmodifiable Map of all sub-types to their supertypes.

Returns:
a defensively copied, unmodifiable Map of all sub-types to their supertypes.
    // build a defensive copy of the type lookup map.
    Map<StringCollection<String>> newLookupMap = new HashMap<StringCollection<String>>();
    for (Map.Entry<StringCollection<String>> entry : .entrySet()) {
      newLookupMap.put(entry.getKey(), Collections.unmodifiableSet(new LinkedHashSet<String>(entry.getValue())));
    }
    return unmodifiableMap(newLookupMap);
  }
  public void addLookup(final String subtypefinal String superType) {
    Collection<StringsuperTypes = .get(subtype);
    if (superTypes == null) {
      .put(subtypesuperTypes = new LinkedHashSet<String>());
    }
    superTypes.add(superType);
  }
New to GrepCode? Check out our FAQ X