Package io.github.emcw.utils
Class Funcs
java.lang.Object
io.github.emcw.utils.Funcs
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static int
calcArea
(int[] X, int[] Z) static int
calcArea
(int[] X, int[] Z, int numPoints, int @NotNull ... divisor) collectAsMap
(@NotNull Stream<Map.Entry<String, T>> stream) collectEntities
(@NotNull Stream<? extends BaseEntity<T>> stream) static <T> List<T>
collectList
(Stream<T> stream, Boolean noDuplicates) static Integer
euclidean
(int x1, int x2, int z1, int z2) listToMap
(@NotNull List<BaseEntity<T>> list) static @NotNull Integer
manhattan
(int x1, int x2, int z1, int z2) static @NotNull Integer
static <K,
V> @NotNull List<V> static @NotNull Integer
range
(int[] args) static <T> List<T>
removeListDuplicates
(@NotNull List<T> list) static @NotNull IntStream
streamIntRange
(int max, int @NotNull ... min) static @NotNull IntStream
streamInts
(int... ints) static <T> Stream<T>
streamList
(@NotNull List<T> list) static boolean
withinRadius
(Integer num, Integer @NotNull [] args) static boolean
withinRadius
(Integer sourceCoord, Integer targetCoord, Integer radius)
-
Constructor Details
-
Funcs
public Funcs()
-
-
Method Details
-
listToMap
@NotNull public static <T> @NotNull Map<String,T> listToMap(@NotNull @NotNull List<BaseEntity<T>> list) -
mapToList
-
collectEntities
public static <T> Map<String,T> collectEntities(@NotNull @NotNull Stream<? extends BaseEntity<T>> stream) -
collectAsMap
-
arrayHas
-
calcArea
public static int calcArea(int[] X, int[] Z) -
calcArea
public static int calcArea(int[] X, int[] Z, int numPoints, int @NotNull ... divisor) -
range
-
euclidean
-
manhattan
-
manhattan
-
removeListDuplicates
-
collectList
-
streamList
-
streamIntRange
-
streamInts
-
withinRadius
-
withinRadius
-