List of usage examples for java.util Collections synchronizedMap
public static <K, V> Map<K, V> synchronizedMap(Map<K, V> m)
From source file:Main.java
public static <K, V> Map<K, V> synchronizedHashMap() { return Collections.synchronizedMap(new HashMap<K, V>()); }
From source file:Main.java
public static <K, V> Map<K, V> newSyncronizedHashMap() { return Collections.synchronizedMap(new HashMap<>()); }
From source file:Main.java
public static <K, V> Map<K, V> synchronizedMap() { return Collections.synchronizedMap(new HashMap<K, V>()); }
From source file:Main.java
public static <K, V> Map<K, V> synchronizedMap(final int initialCapacity) { return Collections.synchronizedMap(new HashMap<K, V>(initialCapacity)); }
From source file:Main.java
public static <K, V> Map<K, V> newSynchronizedTreeMap() { final TreeMap<K, V> treeMap = newTreeMap(); return Collections.synchronizedMap(treeMap); }
From source file:Main.java
protected static <K, V> Map<K, V> synchronizedMap(final int initialCapacity, final float loadFactor) { return Collections.synchronizedMap(new HashMap<K, V>(initialCapacity, loadFactor)); }
From source file:Main.java
public static <K extends Object, V extends Object> Map<K, V> synchronizedMap(final Map<K, V> map) { return Collections.synchronizedMap(map); }
From source file:org.openmrs.web.user.CurrentUsers.java
/** * Initialize the current users list.//w w w. j a v a 2 s. com * * @param servletContext */ public static Map<String, String> init(ServletContext servletContext) { Map<String, String> currentUserMap = Collections.synchronizedMap(new TreeMap<String, String>()); servletContext.setAttribute(WebConstants.CURRENT_USERS, currentUserMap); return currentUserMap; }
From source file:Main.java
public static <K, V> Map<K, V> synchronizedMap() { return Collections.synchronizedMap(Maps.<K, V>newHashMap()); }
From source file:Main.java
public static <K, V> Map<K, V> synchronizedMap(int initialCapacity) { return Collections.synchronizedMap(new HashMap<K, V>(initialCapacity)); }