Package dsa.lib.utils
Class ArrayUtils
java.lang.Object
dsa.lib.utils.ArrayUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <Item> Item[]chain(Item[]... itemss) static <Item> Item[]static <Item> Item[]chain(IntFunction<Item[]> makeArray, Item[]... itemss) static <Item> voidcopy(int size, Item[] from, int fromStart, Item[] to) static <Item> voidcopy(int size, Item[] from, int fromStart, Item[] to, int toStart) static <Item> voidcopy(int size, Item[] from, Item[] to) static <Item> voidcopy(int size, Item[] from, Item[] to, int toStart) static <Item> Item[]copy(Item[] items) static <Item> voidcopy(Item[] from, int fromStart, Item[] to) static <Item> voidcopy(Item[] from, int fromStart, Item[] to, int toStart) static <Item> voidcopy(Item[] from, Item[] to) static <Item> voidcopy(Item[] from, Item[] to, int toStart) static <Item> Item[]static <Item> Item[]copy(IntFunction<Item[]> makeArray, Item[] items) static <Item> Item[]empty()static <Item> Item[]static <Item> Item[]empty(IntFunction<Item[]> makeArray) static <Item> Item[]from(int size, IntFunction<Item> item) static <Item> Item[]from(Class<?> itemClass, int size, IntFunction<Item> item) static <Item> Item[]static <Item> Item[]from(Class<?> itemClass, Collection<Item> items) static <Item> Item[]static <Item> Item[]static <Item> Item[]static <Item> Item[]from(Collection<Item> items) static <Item> Item[]from(IntFunction<Item[]> makeArray, int size, IntFunction<Item> item) static <Item> Item[]from(IntFunction<Item[]> makeArray, Iterable<Item> items) static <Item> Item[]from(IntFunction<Item[]> makeArray, Collection<Item> items) static <Item> Item[]from(IntFunction<Item[]> makeArray, Iterator<Item> items) static <Item> Item[]from(IntFunction<Item[]> makeArray, Stream<Item> items) static <Item> Item[]static <Item> Item[]static <T> T[]make(int size) static <Item> Item[]static <Item> IntFunction<Item[]> static <Item> IntFunction<Item[]> static <Item> Item[]repeat(int repetitions, Item item) static <Item> Item[]static <Item> Item[]repeat(IntFunction<Item[]> makeArray, int repetitions, Item item) static <Item,Result>
Result[]replace(Item[] items, BiFunction<Item, Integer, Result> function) static <Item,Result>
Result[]static <Item,Result>
Result[]replace(Class<?> resultClass, Item[] items, BiFunction<Item, Integer, Result> function) static <Item,Result>
Result[]static <Item,Result>
Result[]replace(IntFunction<Result[]> makeResultArray, Item[] items, BiFunction<Item, Integer, Result> function) static <Item,Result>
Result[]replace(IntFunction<Result[]> makeResultArray, Item[] items, Function<Item, Result> function) static <Item> Item[]reversed(Item[] items) static <Item> Item[]static <Item> Item[]reversed(IntFunction<Item[]> makeArray, Item[] items) static <Item> Item[]singleton(Item item) static <Item> Item[]static <Item> Item[]singleton(IntFunction<Item[]> makeArray, Item item) static <Item> Item[]sorted(Item[] items) static <Item> Item[]sorted(Item[] items, Comparator<Item> comparator) static <Item> Item[]static <Item> Item[]sorted(Class<?> itemClass, Item[] items, Comparator<Item> comparator) static <Item> Item[]sorted(IntFunction<Item[]> makeArray, Item[] items) static <Item> Item[]sorted(IntFunction<Item[]> makeArray, Item[] items, Comparator<Item> comparator) static Stringstatic Stringstatic StringtoUntypedString(Object[] array) static StringtoUntypedString(Object[] array, String indent)
-
Method Details
-
make
public static <T> T[] make(int size) -
make
-
makeUntyped
-
makeTyped
-
empty
-
empty
public static <Item> Item[] empty() -
empty
-
singleton
-
singleton
public static <Item> Item[] singleton(Item item) -
singleton
-
repeat
-
repeat
-
repeat
public static <Item> Item[] repeat(int repetitions, Item item) -
from
-
from
-
from
-
from
-
from
-
from
-
from
-
from
-
from
-
from
-
from
-
from
-
from
-
from
-
from
-
chain
-
chain
-
chain
-
replace
public static <Item,Result> Result[] replace(IntFunction<Result[]> makeResultArray, Item[] items, BiFunction<Item, Integer, Result> function) -
replace
public static <Item,Result> Result[] replace(Item[] items, BiFunction<Item, Integer, Result> function) -
replace
public static <Item,Result> Result[] replace(Class<?> resultClass, Item[] items, BiFunction<Item, Integer, Result> function) -
replace
public static <Item,Result> Result[] replace(IntFunction<Result[]> makeResultArray, Item[] items, Function<Item, Result> function) -
replace
-
replace
-
copy
public static <Item> void copy(int size, Item[] from, int fromStart, Item[] to, int toStart) -
copy
public static <Item> void copy(int size, Item[] from, int fromStart, Item[] to) -
copy
public static <Item> void copy(int size, Item[] from, Item[] to, int toStart) -
copy
public static <Item> void copy(int size, Item[] from, Item[] to) -
copy
public static <Item> void copy(Item[] from, int fromStart, Item[] to, int toStart) -
copy
public static <Item> void copy(Item[] from, int fromStart, Item[] to) -
copy
public static <Item> void copy(Item[] from, Item[] to, int toStart) -
copy
public static <Item> void copy(Item[] from, Item[] to) -
copy
-
copy
public static <Item> Item[] copy(Item[] items) -
copy
-
sorted
-
sorted
public static <Item> Item[] sorted(Item[] items) -
sorted
-
sorted
public static <Item> Item[] sorted(IntFunction<Item[]> makeArray, Item[] items, Comparator<Item> comparator) -
sorted
-
sorted
-
reversed
-
reversed
public static <Item> Item[] reversed(Item[] items) -
reversed
-
toString
-
toString
-
toUntypedString
-
toUntypedString
-