Package org.apache.ignite.internal.util
Class GridCollections
- java.lang.Object
-
- org.apache.ignite.internal.util.GridCollections
-
public final class GridCollections extends Object
Provides locked wrappers around given maps and collections. SinceReentrantLockperforms a lot better than standard Javasynchronization, these locked wrappers should perform better as their analogous methods injava.util.Collectionsclass.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E> Collection<E>lockedCollection(Collection<E> c)Gets locked collection wrapping given set.static <K,V>
Map<K,V>lockedMap(Map<K,V> m)Gets locked map wrapping given map.static <E> Set<E>lockedSet(Set<E> s)Gets locked set wrapping given set.
-
-
-
Method Detail
-
lockedMap
public static <K,V> Map<K,V> lockedMap(Map<K,V> m)
Gets locked map wrapping given map.- Parameters:
m- Map to wrap into locked implementation.- Returns:
- Locked map.
-
lockedSet
public static <E> Set<E> lockedSet(Set<E> s)
Gets locked set wrapping given set.- Parameters:
s- Set to wrap into locked implementation.- Returns:
- Locked set.
-
lockedCollection
public static <E> Collection<E> lockedCollection(Collection<E> c)
Gets locked collection wrapping given set.- Parameters:
c- Collection to wrap into locked implementation.- Returns:
- Locked collection.
-
-