From 871949bcae69145b3cf53bcd4c9d63c56d5b1ffe Mon Sep 17 00:00:00 2001 From: Zepalesque <60141811+Zepalesque@users.noreply.github.com> Date: Wed, 22 May 2024 21:51:38 -0400 Subject: [PATCH] refactor: New system --- .../zenith/util/lambda/Consumers.java | 34 +++++++++++++++++++ .../zenith/util/lambda/Functions.java | 34 +++++++++++++++++++ .../util/lambda/consumer/HexConsumer.java | 26 -------------- .../util/lambda/consumer/QuadConsumer.java | 22 ------------ .../util/lambda/consumer/SeptConsumer.java | 28 --------------- .../util/lambda/function/HexFunction.java | 28 --------------- .../util/lambda/function/OctoFunction.java | 32 ----------------- .../util/lambda/function/QuadFunction.java | 23 ------------- 8 files changed, 68 insertions(+), 159 deletions(-) create mode 100644 src/main/java/net/zepalesque/zenith/util/lambda/Consumers.java create mode 100644 src/main/java/net/zepalesque/zenith/util/lambda/Functions.java delete mode 100644 src/main/java/net/zepalesque/zenith/util/lambda/consumer/HexConsumer.java delete mode 100644 src/main/java/net/zepalesque/zenith/util/lambda/consumer/QuadConsumer.java delete mode 100644 src/main/java/net/zepalesque/zenith/util/lambda/consumer/SeptConsumer.java delete mode 100644 src/main/java/net/zepalesque/zenith/util/lambda/function/HexFunction.java delete mode 100644 src/main/java/net/zepalesque/zenith/util/lambda/function/OctoFunction.java delete mode 100644 src/main/java/net/zepalesque/zenith/util/lambda/function/QuadFunction.java diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/Consumers.java b/src/main/java/net/zepalesque/zenith/util/lambda/Consumers.java new file mode 100644 index 0000000..1404a3d --- /dev/null +++ b/src/main/java/net/zepalesque/zenith/util/lambda/Consumers.java @@ -0,0 +1,34 @@ +package net.zepalesque.zenith.util.lambda; + +public class Consumers { + + public static interface C3 { + + void accept(T1 t1, T2 t2, T3 t3); + } + + public static interface C4 { + + void accept(T1 t1, T2 t2, T3 t3, T4 t4); + } + + public static interface C5 { + + void accept(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5); + } + + public static interface C6 { + + void accept(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6); + } + + public static interface C7 { + + void accept(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7); + } + + public static interface C8 { + + void accept(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8); + } +} diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/Functions.java b/src/main/java/net/zepalesque/zenith/util/lambda/Functions.java new file mode 100644 index 0000000..d4a3720 --- /dev/null +++ b/src/main/java/net/zepalesque/zenith/util/lambda/Functions.java @@ -0,0 +1,34 @@ +package net.zepalesque.zenith.util.lambda; + +public class Functions { + + public static interface F3 { + + R accept(T1 t1, T2 t2, T3 t3); + } + + public static interface F4 { + + R accept(T1 t1, T2 t2, T3 t3, T4 t4); + } + + public static interface F5 { + + R accept(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5); + } + + public static interface F6 { + + R accept(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6); + } + + public static interface F7 { + + R accept(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7); + } + + public static interface F8 { + + R accept(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8); + } +} diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/consumer/HexConsumer.java b/src/main/java/net/zepalesque/zenith/util/lambda/consumer/HexConsumer.java deleted file mode 100644 index a4bf079..0000000 --- a/src/main/java/net/zepalesque/zenith/util/lambda/consumer/HexConsumer.java +++ /dev/null @@ -1,26 +0,0 @@ -package net.zepalesque.zenith.util.lambda.consumer; - -/** - * An operation that accepts six upper arguments and returns no result. - * - * @param type of the first argument - * @param type of the second argument - * @param type of the third argument - * @param type of the fourth argument - * @param type of the fifth argument - * @param type of the sixth argument - * - */ -public interface HexConsumer { - - /** - * Performs the operation given the specified arguments. - * @param k the first upper argument - * @param v the second upper argument - * @param s the third upper argument - * @param t the fourth upper argument - * @param r the fifth upper argument - * @param y the sixth upper argument - */ - void accept(K k, V v, S s, T t, R r, Y y); -} \ No newline at end of file diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/consumer/QuadConsumer.java b/src/main/java/net/zepalesque/zenith/util/lambda/consumer/QuadConsumer.java deleted file mode 100644 index 1de0d23..0000000 --- a/src/main/java/net/zepalesque/zenith/util/lambda/consumer/QuadConsumer.java +++ /dev/null @@ -1,22 +0,0 @@ -package net.zepalesque.zenith.util.lambda.consumer; - -/** - * An operation that accepts four upper arguments and returns no result. - * - * @param type of the first argument - * @param type of the second argument - * @param type of the third argument - * @param type of the fourth argument - - */ -public interface QuadConsumer { - - /** - * Performs the operation given the specified arguments. - * @param k the first upper argument - * @param v the second upper argument - * @param s the third upper argument - * @param t the fourth upper argument - */ - void accept(K k, V v, S s, T t); -} \ No newline at end of file diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/consumer/SeptConsumer.java b/src/main/java/net/zepalesque/zenith/util/lambda/consumer/SeptConsumer.java deleted file mode 100644 index 81a86c8..0000000 --- a/src/main/java/net/zepalesque/zenith/util/lambda/consumer/SeptConsumer.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.zepalesque.zenith.util.lambda.consumer; - -/** - * An operation that accepts seven upper arguments and returns no result. - * - * @param type of the first argument - * @param type of the second argument - * @param type of the third argument - * @param type of the fourth argument - * @param type of the fifth argument - * @param type of the sixth argument - * @param type of the seventh argument - - */ -public interface SeptConsumer { - - /** - * Performs the operation given the specified arguments. - * @param k the first upper argument - * @param v the second upper argument - * @param s the third upper argument - * @param t the fourth upper argument - * @param r the fifth upper argument - * @param q the sixth upper argument - * @param l the seventh upper argument - */ - void accept(K k, V v, S s, T t, R r, Q q, L l); -} \ No newline at end of file diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/function/HexFunction.java b/src/main/java/net/zepalesque/zenith/util/lambda/function/HexFunction.java deleted file mode 100644 index 9f3adb5..0000000 --- a/src/main/java/net/zepalesque/zenith/util/lambda/function/HexFunction.java +++ /dev/null @@ -1,28 +0,0 @@ -package net.zepalesque.zenith.util.lambda.function; - -/** - * An operation that accepts six upper arguments and returns a result. - * - * @param type of the first argument - * @param type of the second argument - * @param type of the third argument - * @param type of the fourth argument - * @param type of the fifth argument - * @param type of the sixth argument - * - * @param type of the return value - - */ -public interface HexFunction { - - /** - * Performs the operation given the specified arguments. - * @param k the first upper argument - * @param v the second upper argument - * @param s the third upper argument - * @param t the fourth upper argument - * @param r the fifth upper argument - * @param y the sixth upper argument - */ - Z apply(K k, V v, S s, T t, R r, Y y); -} \ No newline at end of file diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/function/OctoFunction.java b/src/main/java/net/zepalesque/zenith/util/lambda/function/OctoFunction.java deleted file mode 100644 index 9afd316..0000000 --- a/src/main/java/net/zepalesque/zenith/util/lambda/function/OctoFunction.java +++ /dev/null @@ -1,32 +0,0 @@ -package net.zepalesque.zenith.util.lambda.function; - -/** - * An operation that accepts eight upper arguments and returns a result. - * - * @param type of the first argument - * @param type of the second argument - * @param type of the third argument - * @param type of the fourth argument - * @param type of the fifth argument - * @param type of the sixth argument - * @param type of the seventh argument - * @param type of the eighth argument - * - * @param type of the return value - - */ -public interface OctoFunction { - - /** - * Performs the operation given the specified arguments. - * @param k the first upper argument - * @param v the second upper argument - * @param s the third upper argument - * @param t the fourth upper argument - * @param r the fifth upper argument - * @param q the sixth upper argument - * @param l the seventh upper argument - * @param x the eighth upper argument - */ - Z apply(K k, V v, S s, T t, R r, Q q, L l, X x); -} \ No newline at end of file diff --git a/src/main/java/net/zepalesque/zenith/util/lambda/function/QuadFunction.java b/src/main/java/net/zepalesque/zenith/util/lambda/function/QuadFunction.java deleted file mode 100644 index 1f7ca73..0000000 --- a/src/main/java/net/zepalesque/zenith/util/lambda/function/QuadFunction.java +++ /dev/null @@ -1,23 +0,0 @@ -package net.zepalesque.zenith.util.lambda.function; - -/** - * An operation that accepts four upper arguments and returns a result. - * - * @param type of the first argument - * @param type of the second argument - * @param type of the third argument - * @param type of the fourth argument - * @param type of the result - - */ -public interface QuadFunction { - - /** - * Performs the operation given the specified arguments. - * @param k the first upper argument - * @param v the second upper argument - * @param s the third upper argument - * @param t the fourth upper argument - */ - R apply(K k, V v, S s, T t); -} \ No newline at end of file