Create a ConcurrentHashMap (faster than the above because of its striped locking) and create a set from it.
http://java.sun.com/javase/6/docs/api/java/util/Collections.html#newSetFromMap%28java.util.Map%29
public static <E> Set<E> newSetFromMap(Map<E,Boolean> map)
No comments:
Post a Comment