Package com.intellij.util.containers
Class ContainerUtilRt
java.lang.Object
com.intellij.util.containers.ContainerUtilRt
- Direct Known Subclasses:
ContainerUtil
Stripped-down version of
com.intellij.util.containers.ContainerUtil.
Intended to use by external (out-of-IDE-process) runners and helpers so it should not contain any library dependencies.- Since:
- 12.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> voidaddIfNotNull(Collection<T> result, T element) static <T> voidaddIfNotNull(T element, Collection<T> result) Deprecated.static <T> CopyOnWriteArrayList<T> static <T> List<T> static <T,V> List <V> map2List(Collection<? extends T> collection, Function<T, V> mapper) static <T,V> List <V> static <T,V> Set <V> map2Set(Collection<? extends T> collection, Function<T, V> mapper) static <T,V> Set <V> static <T> ArrayList<T> static <T> ArrayList<T> newArrayList(Iterable<? extends T> elements) static <T> ArrayList<T> newArrayList(T... elements) static <T> ArrayList<T> newArrayListWithCapacity(int size) static <K,V> HashMap <K, V> static <K,V> Map <K, V> newHashMap(int initialCapacity) static <K,V> Map <K, V> newHashMap(Pair<K, ? extends V> first, Pair<K, ? extends V>... entries) static <K,V> Map <K, V> newHashMap(List<K> keys, List<V> values) static <K,V> HashMap <K, V> newHashMap(Map<? extends K, ? extends V> map) static <T> HashSet<T> static <T> HashSet<T> newHashSet(int initialCapacity) static <T> HashSet<T> newHashSet(Iterable<? extends T> elements) static <T> HashSet<T> newHashSet(Iterator<? extends T> iterator) static <T> HashSet<T> newHashSet(T... elements) static <K,V> LinkedHashMap <K, V> static <K,V> LinkedHashMap <K, V> newLinkedHashMap(int capacity) static <K,V> LinkedHashMap <K, V> newLinkedHashMap(Pair<K, V> first, Pair<K, V>[] entries) static <K,V> LinkedHashMap <K, V> newLinkedHashMap(Map<K, V> map) static <T> LinkedHashSet<T> static <T> LinkedHashSet<T> newLinkedHashSet(Iterable<? extends T> elements) static <T> LinkedHashSet<T> newLinkedHashSet(T... elements) static <T> LinkedList<T> static <T> LinkedList<T> newLinkedList(Iterable<? extends T> elements) static <T> LinkedList<T> newLinkedList(T... elements) static <T> Stack<T> newStack()static <T> Stack<T> newStack(Collection<T> elements) static <T> Stack<T> newStack(T... initial) static <K extends Comparable,V>
TreeMap<K, V> static <K extends Comparable,V>
TreeMap<K, V> newTreeMap(Map<K, V> map) static <T> TreeSet<T> static <T> TreeSet<T> newTreeSet(Iterable<? extends T> elements) static <T> TreeSet<T> newTreeSet(Comparator<? super T> comparator) static <T> TreeSet<T> newTreeSet(T... elements) static <T> T[]toArray(Collection<T> c, T[] sample) This is a replacement forCollection.toArray(Object[]).static <T> T[]
-
Constructor Details
-
ContainerUtilRt
public ContainerUtilRt()
-
-
Method Details
-
newHashMap
-
newHashMap
-
newHashMap
-
newHashMap
-
newHashMap
-
newTreeMap
-
newTreeMap
-
newLinkedHashMap
-
newLinkedHashMap
@NotNull @Contract(pure=true) public static <K,V> LinkedHashMap<K,V> newLinkedHashMap(int capacity) -
newLinkedHashMap
-
newLinkedHashMap
-
newLinkedList
-
newLinkedList
-
newLinkedList
-
newArrayList
-
newArrayList
-
newArrayList
-
newArrayListWithCapacity
-
newHashSet
-
newHashSet
-
newHashSet
-
newHashSet
-
newHashSet
-
newLinkedHashSet
-
newLinkedHashSet
@NotNull @Contract(pure=true) public static <T> LinkedHashSet<T> newLinkedHashSet(@NotNull T... elements) -
newLinkedHashSet
-
newTreeSet
-
newTreeSet
-
newTreeSet
-
newTreeSet
-
newStack
-
newStack
-
newStack
-
emptyList
-
createEmptyCOWList
-
addIfNotNull
Deprecated.- See Also:
-
addIfNotNull
-
map2List
@NotNull @Contract(pure=true) public static <T,V> List<V> map2List(@NotNull T[] array, @NotNull Function<T, V> mapper) - Returns:
- read-only list consisting of the elements from array converted by mapper
-
map2List
@NotNull @Contract(pure=true) public static <T,V> List<V> map2List(@NotNull Collection<? extends T> collection, @NotNull Function<T, V> mapper) - Returns:
- read-only list consisting of the elements from collection converted by mapper
-
map2Set
@NotNull @Contract(pure=true) public static <T,V> Set<V> map2Set(@NotNull T[] collection, @NotNull Function<T, V> mapper) - Returns:
- read-only set consisting of the elements from collection converted by mapper
-
map2Set
@NotNull @Contract(pure=true) public static <T,V> Set<V> map2Set(@NotNull Collection<? extends T> collection, @NotNull Function<T, V> mapper) - Returns:
- read-only set consisting of the elements from collection converted by mapper
-
toArray
-
toArray
This is a replacement forCollection.toArray(Object[]). For small collections it is faster to stay at java level and refrain from calling JNISystem.arraycopy(Object, int, Object, int, int)
-