Package org.checkerframework.javacutil
Class CollectionUtils
java.lang.Object
org.checkerframework.javacutil.CollectionUtils
Utility methods related to Java Collections.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends @Nullable Object,
C extends @Nullable Collection<T>>
@PolyNull CcloneElements
(@PolyNull C orig) Deprecated.use org.plumelib.util.CollectionsPlume.cloneElementscloneElements
(@PolyNull M orig) Deprecated.use org.plumelib.util.CollectionsPlume.cloneElementscloneValues
(@PolyNull M orig) Deprecated.use org.plumelib.util.CollectionsPlume.cloneValuesstatic <K,
V> Map <K, V> createLRUCache
(int size) Deprecated.use org.plumelib.util.CollectionsPlume.createLruCachestatic <T extends @Nullable org.plumelib.util.DeepCopyable<T>,
C extends @Nullable Collection<T>>
@PolyNull CDeprecated.use org.plumelib.util.CollectionsPlume.deepCopystatic <K extends @Nullable org.plumelib.util.DeepCopyable<K>,
V extends @Nullable org.plumelib.util.DeepCopyable<V>, M extends @Nullable Map<K, V>>
@PolyNull MDeprecated.use org.plumelib.util.CollectionsPlume.deepCopystatic <K,
V extends @Nullable org.plumelib.util.DeepCopyable<V>, M extends @Nullable Map<K, V>>
@PolyNull MdeepCopyValues
(@PolyNull M orig) Deprecated.use org.plumelib.util.CollectionsPlume.deepCopyValues
-
Method Details
-
createLRUCache
Deprecated.use org.plumelib.util.CollectionsPlume.createLruCacheCreates a LRU cache.- Parameters:
size
- size of the cache- Returns:
- a new cache with the provided size
-
cloneElements
@Deprecated public static <T extends @Nullable Object,C extends @Nullable Collection<T>> @PolyNull C cloneElements(@PolyNull C orig) Deprecated.use org.plumelib.util.CollectionsPlume.cloneElementsReturns a copy oforig
, where each element of the result is a clone of the corresponding element oforig
.- Type Parameters:
T
- the type of elements of the collectionC
- the type of the collection- Parameters:
orig
- a collection- Returns:
- a copy of
orig
, as described above
-
cloneElements
@Deprecated public static <K,V, @PolyNull M cloneElementsM extends @Nullable Map<K, V>> (@PolyNull M orig) Deprecated.use org.plumelib.util.CollectionsPlume.cloneElementsReturns a copy oforig
, where each key and value in the result is a clone of the corresponding element oforig
.- Type Parameters:
K
- the type of keys of the mapV
- the type of values of the mapM
- the type of the map- Parameters:
orig
- a map- Returns:
- a copy of
orig
, as described above
-
cloneValues
@Deprecated public static <K,V, @PolyNull M cloneValuesM extends @Nullable Map<K, V>> (@PolyNull M orig) Deprecated.use org.plumelib.util.CollectionsPlume.cloneValuesReturns a copy oforig
, where each value of the result is a clone of the corresponding value oforig
, but the keys are the same objects.- Type Parameters:
K
- the type of keys of the mapV
- the type of values of the mapM
- the type of the map- Parameters:
orig
- a map- Returns:
- a copy of
orig
, as described above
-
deepCopy
@Deprecated public static <T extends @Nullable org.plumelib.util.DeepCopyable<T>,C extends @Nullable Collection<T>> @PolyNull C deepCopy(@PolyNull C orig) Deprecated.use org.plumelib.util.CollectionsPlume.deepCopyReturns a copy oforig
, where each element of the result is a deep copy (according to theDeepCopyable
interface) of the corresponding element oforig
.- Type Parameters:
T
- the type of elements of the collectionC
- the type of the collection- Parameters:
orig
- a collection- Returns:
- a copy of
orig
, as described above
-
deepCopy
@Deprecated public static <K extends @Nullable org.plumelib.util.DeepCopyable<K>,V extends @Nullable org.plumelib.util.DeepCopyable<V>, @PolyNull M deepCopyM extends @Nullable Map<K, V>> (@PolyNull M orig) Deprecated.use org.plumelib.util.CollectionsPlume.deepCopyReturns a copy oforig
, where each key and value in the result is a deep copy (according to theDeepCopyable
interface) of the corresponding element oforig
.- Type Parameters:
K
- the type of keys of the mapV
- the type of values of the mapM
- the type of the map- Parameters:
orig
- a map- Returns:
- a copy of
orig
, as described above
-
deepCopyValues
@Deprecated public static <K,V extends @Nullable org.plumelib.util.DeepCopyable<V>, @PolyNull M deepCopyValuesM extends @Nullable Map<K, V>> (@PolyNull M orig) Deprecated.use org.plumelib.util.CollectionsPlume.deepCopyValuesReturns a copy oforig
, where each value of the result is a deep copy (according to theDeepCopyable
interface) of the corresponding value oforig
, but the keys are the same objects.- Type Parameters:
K
- the type of keys of the mapV
- the type of values of the mapM
- the type of the map- Parameters:
orig
- a map- Returns:
- a copy of
orig
, as described above
-