java.lang.Object
ushiosan.jvm.collections.UVector
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @NotNull Collection<T>Combine different lists into a single collectionstatic <T> @NotNull Collection<T>Combine different lists into a single collectionstatic booleanisUnmodifiable(@NotNull Collection<?> collection) Check if the inspected collection supports the modification of its datastatic booleanisUnmodifiable(@NotNull Map<?, ?> map) Check if the inspected collection supports the modification of its datamake(@NotNull Collection<T> base) Create a vector with all given elements.Create a vector with all given elements.Create a vector with all given elements.Converts one vector to another but with a different data type.
-
Method Details
-
make
Create a vector with all given elements.- Type Parameters:
T- generic type list- Parameters:
elements- the elements to insert- Returns:
- a linked list with all elements
-
make
Create a vector with all given elements.- Type Parameters:
T- generic type list- Parameters:
base- the base collection content- Returns:
- a linked list with all elements
-
make
Create a vector with all given elements.- Type Parameters:
T- generic type list- Parameters:
iterator- the base collection content- Returns:
- a linked list with all elements
-
transform
@NotNull public static <T,R> @NotNull Vector<R> transform(@NotNull @NotNull Vector<T> original, @NotNull @NotNull Function<T, R> mapper) Converts one vector to another but with a different data type.- Type Parameters:
T- the original data typeR- the target data type- Parameters:
original- the original vector that you want to convertmapper- function in charge of transforming each element of the vector- Returns:
- the new vector with the converted data
-
isUnmodifiable
Check if the inspected collection supports the modification of its data- Parameters:
collection- the collection of data you want to inspect- Returns:
trueif the collection is immutable orfalseotherwise
-
isUnmodifiable
Check if the inspected collection supports the modification of its data- Parameters:
map- the map of data you want to inspect- Returns:
trueif the collection is immutable orfalseotherwise
-
combine
@SafeVarargs @NotNull public static <T> @NotNull Collection<T> combine(boolean excludeDuplicates, List<T> @NotNull ... lts) Combine different lists into a single collection- Type Parameters:
T- generic collection type- Parameters:
excludeDuplicates- remove all duplicate itemslts- the lists you want to merge- Returns:
- returns a single collection with all the elements of the passed lists
-
combine
Combine different lists into a single collection- Type Parameters:
T- generic collection type- Parameters:
lts- the lists you want to merge- Returns:
- returns a single collection with all the elements of the passed lists
-