diff --git a/build.gradle b/build.gradle index f670a9a..59ce3a2 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ group = 'io.github.ititus' version = '2.0.0' wrapper { - gradleVersion '7.3.1' + gradleVersion '7.3.3' } java { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 84d1f85..2e6e589 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/io/github/ititus/data/ArrayUtil.java b/src/main/java/io/github/ititus/commons/data/ArrayUtil.java similarity index 98% rename from src/main/java/io/github/ititus/data/ArrayUtil.java rename to src/main/java/io/github/ititus/commons/data/ArrayUtil.java index d54bf35..d2a81b9 100644 --- a/src/main/java/io/github/ititus/data/ArrayUtil.java +++ b/src/main/java/io/github/ititus/commons/data/ArrayUtil.java @@ -1,4 +1,4 @@ -package io.github.ititus.data; +package io.github.ititus.commons.data; import java.util.Arrays; diff --git a/src/main/java/io/github/ititus/data/CollectionUtil.java b/src/main/java/io/github/ititus/commons/data/CollectionUtil.java similarity index 90% rename from src/main/java/io/github/ititus/data/CollectionUtil.java rename to src/main/java/io/github/ititus/commons/data/CollectionUtil.java index 1789426..33a0f69 100644 --- a/src/main/java/io/github/ititus/data/CollectionUtil.java +++ b/src/main/java/io/github/ititus/commons/data/CollectionUtil.java @@ -1,4 +1,4 @@ -package io.github.ititus.data; +package io.github.ititus.commons.data; import java.util.List; import java.util.function.Function; diff --git a/src/main/java/io/github/ititus/data/DeepToString.java b/src/main/java/io/github/ititus/commons/data/DeepToString.java similarity index 62% rename from src/main/java/io/github/ititus/data/DeepToString.java rename to src/main/java/io/github/ititus/commons/data/DeepToString.java index 5d4ed97..5c0c46e 100644 --- a/src/main/java/io/github/ititus/data/DeepToString.java +++ b/src/main/java/io/github/ititus/commons/data/DeepToString.java @@ -1,4 +1,4 @@ -package io.github.ititus.data; +package io.github.ititus.commons.data; public interface DeepToString { diff --git a/src/main/java/io/github/ititus/data/EmptyIterable.java b/src/main/java/io/github/ititus/commons/data/EmptyIterable.java similarity index 91% rename from src/main/java/io/github/ititus/data/EmptyIterable.java rename to src/main/java/io/github/ititus/commons/data/EmptyIterable.java index 595e3e9..15e62e7 100644 --- a/src/main/java/io/github/ititus/data/EmptyIterable.java +++ b/src/main/java/io/github/ititus/commons/data/EmptyIterable.java @@ -1,4 +1,4 @@ -package io.github.ititus.data; +package io.github.ititus.commons.data; import java.util.*; import java.util.function.Consumer; diff --git a/src/main/java/io/github/ititus/data/ImmutableIterator.java b/src/main/java/io/github/ititus/commons/data/ImmutableIterator.java similarity index 94% rename from src/main/java/io/github/ititus/data/ImmutableIterator.java rename to src/main/java/io/github/ititus/commons/data/ImmutableIterator.java index 28d1fa6..05c0315 100644 --- a/src/main/java/io/github/ititus/data/ImmutableIterator.java +++ b/src/main/java/io/github/ititus/commons/data/ImmutableIterator.java @@ -1,4 +1,4 @@ -package io.github.ititus.data; +package io.github.ititus.commons.data; import java.util.Enumeration; import java.util.Iterator; diff --git a/src/main/java/io/github/ititus/data/IteratorBuffer.java b/src/main/java/io/github/ititus/commons/data/IteratorBuffer.java similarity index 98% rename from src/main/java/io/github/ititus/data/IteratorBuffer.java rename to src/main/java/io/github/ititus/commons/data/IteratorBuffer.java index e6f9b7c..48aa93e 100644 --- a/src/main/java/io/github/ititus/data/IteratorBuffer.java +++ b/src/main/java/io/github/ititus/commons/data/IteratorBuffer.java @@ -1,4 +1,4 @@ -package io.github.ititus.data; +package io.github.ititus.commons.data; import java.util.Iterator; import java.util.NoSuchElementException; diff --git a/src/main/java/io/github/ititus/data/Lazy.java b/src/main/java/io/github/ititus/commons/data/Lazy.java similarity index 94% rename from src/main/java/io/github/ititus/data/Lazy.java rename to src/main/java/io/github/ititus/commons/data/Lazy.java index 3e4a6a1..570ec03 100644 --- a/src/main/java/io/github/ititus/data/Lazy.java +++ b/src/main/java/io/github/ititus/commons/data/Lazy.java @@ -1,4 +1,4 @@ -package io.github.ititus.data; +package io.github.ititus.commons.data; import java.util.Objects; import java.util.function.Supplier; diff --git a/src/main/java/io/github/ititus/data/ObjectUtil.java b/src/main/java/io/github/ititus/commons/data/ObjectUtil.java similarity index 98% rename from src/main/java/io/github/ititus/data/ObjectUtil.java rename to src/main/java/io/github/ititus/commons/data/ObjectUtil.java index 0e85048..7dc4b49 100644 --- a/src/main/java/io/github/ititus/data/ObjectUtil.java +++ b/src/main/java/io/github/ititus/commons/data/ObjectUtil.java @@ -1,4 +1,4 @@ -package io.github.ititus.data; +package io.github.ititus.commons.data; import java.util.*; diff --git a/src/main/java/io/github/ititus/data/Printable.java b/src/main/java/io/github/ititus/commons/data/Printable.java similarity index 97% rename from src/main/java/io/github/ititus/data/Printable.java rename to src/main/java/io/github/ititus/commons/data/Printable.java index 5af4296..d056b03 100644 --- a/src/main/java/io/github/ititus/data/Printable.java +++ b/src/main/java/io/github/ititus/commons/data/Printable.java @@ -1,4 +1,4 @@ -package io.github.ititus.data; +package io.github.ititus.commons.data; import java.util.Iterator; import java.util.LinkedHashMap; diff --git a/src/main/java/io/github/ititus/data/mutable/Mutable.java b/src/main/java/io/github/ititus/commons/data/mutable/Mutable.java similarity index 89% rename from src/main/java/io/github/ititus/data/mutable/Mutable.java rename to src/main/java/io/github/ititus/commons/data/mutable/Mutable.java index 53de1cb..39f4401 100644 --- a/src/main/java/io/github/ititus/data/mutable/Mutable.java +++ b/src/main/java/io/github/ititus/commons/data/mutable/Mutable.java @@ -1,7 +1,7 @@ -package io.github.ititus.data.mutable; +package io.github.ititus.commons.data.mutable; -import io.github.ititus.data.DeepToString; -import io.github.ititus.data.ObjectUtil; +import io.github.ititus.commons.data.DeepToString; +import io.github.ititus.commons.data.ObjectUtil; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/data/mutable/MutableBoolean.java b/src/main/java/io/github/ititus/commons/data/mutable/MutableBoolean.java similarity index 97% rename from src/main/java/io/github/ititus/data/mutable/MutableBoolean.java rename to src/main/java/io/github/ititus/commons/data/mutable/MutableBoolean.java index b479e33..cb8e3f5 100644 --- a/src/main/java/io/github/ititus/data/mutable/MutableBoolean.java +++ b/src/main/java/io/github/ititus/commons/data/mutable/MutableBoolean.java @@ -1,4 +1,4 @@ -package io.github.ititus.data.mutable; +package io.github.ititus.commons.data.mutable; import java.util.function.Supplier; diff --git a/src/main/java/io/github/ititus/data/mutable/MutableInt.java b/src/main/java/io/github/ititus/commons/data/mutable/MutableInt.java similarity index 96% rename from src/main/java/io/github/ititus/data/mutable/MutableInt.java rename to src/main/java/io/github/ititus/commons/data/mutable/MutableInt.java index 3182ff8..6b73f3a 100644 --- a/src/main/java/io/github/ititus/data/mutable/MutableInt.java +++ b/src/main/java/io/github/ititus/commons/data/mutable/MutableInt.java @@ -1,4 +1,4 @@ -package io.github.ititus.data.mutable; +package io.github.ititus.commons.data.mutable; public final class MutableInt { diff --git a/src/main/java/io/github/ititus/data/pair/IntIntPair.java b/src/main/java/io/github/ititus/commons/data/pair/IntIntPair.java similarity index 79% rename from src/main/java/io/github/ititus/data/pair/IntIntPair.java rename to src/main/java/io/github/ititus/commons/data/pair/IntIntPair.java index 472546d..ecc8043 100644 --- a/src/main/java/io/github/ititus/data/pair/IntIntPair.java +++ b/src/main/java/io/github/ititus/commons/data/pair/IntIntPair.java @@ -1,6 +1,6 @@ -package io.github.ititus.data.pair; +package io.github.ititus.commons.data.pair; -import io.github.ititus.data.pair.impl.IntIntPairImpl; +import io.github.ititus.commons.data.pair.impl.IntIntPairImpl; public interface IntIntPair extends Pair { diff --git a/src/main/java/io/github/ititus/data/pair/IntObjPair.java b/src/main/java/io/github/ititus/commons/data/pair/IntObjPair.java similarity index 75% rename from src/main/java/io/github/ititus/data/pair/IntObjPair.java rename to src/main/java/io/github/ititus/commons/data/pair/IntObjPair.java index 73aabea..06f1bdd 100644 --- a/src/main/java/io/github/ititus/data/pair/IntObjPair.java +++ b/src/main/java/io/github/ititus/commons/data/pair/IntObjPair.java @@ -1,6 +1,6 @@ -package io.github.ititus.data.pair; +package io.github.ititus.commons.data.pair; -import io.github.ititus.data.pair.impl.IntObjPairImpl; +import io.github.ititus.commons.data.pair.impl.IntObjPairImpl; public interface IntObjPair extends Pair { diff --git a/src/main/java/io/github/ititus/data/pair/LongLongPair.java b/src/main/java/io/github/ititus/commons/data/pair/LongLongPair.java similarity index 79% rename from src/main/java/io/github/ititus/data/pair/LongLongPair.java rename to src/main/java/io/github/ititus/commons/data/pair/LongLongPair.java index 06a87f6..75dbe0f 100644 --- a/src/main/java/io/github/ititus/data/pair/LongLongPair.java +++ b/src/main/java/io/github/ititus/commons/data/pair/LongLongPair.java @@ -1,6 +1,6 @@ -package io.github.ititus.data.pair; +package io.github.ititus.commons.data.pair; -import io.github.ititus.data.pair.impl.LongLongPairImpl; +import io.github.ititus.commons.data.pair.impl.LongLongPairImpl; public interface LongLongPair extends Pair { diff --git a/src/main/java/io/github/ititus/data/pair/Pair.java b/src/main/java/io/github/ititus/commons/data/pair/Pair.java similarity index 73% rename from src/main/java/io/github/ititus/data/pair/Pair.java rename to src/main/java/io/github/ititus/commons/data/pair/Pair.java index 42f2a4c..1a68e33 100644 --- a/src/main/java/io/github/ititus/data/pair/Pair.java +++ b/src/main/java/io/github/ititus/commons/data/pair/Pair.java @@ -1,7 +1,7 @@ -package io.github.ititus.data.pair; +package io.github.ititus.commons.data.pair; -import io.github.ititus.data.DeepToString; -import io.github.ititus.data.pair.impl.PairImpl; +import io.github.ititus.commons.data.DeepToString; +import io.github.ititus.commons.data.pair.impl.PairImpl; public interface Pair extends DeepToString { diff --git a/src/main/java/io/github/ititus/data/pair/impl/IntIntPairImpl.java b/src/main/java/io/github/ititus/commons/data/pair/impl/IntIntPairImpl.java similarity index 83% rename from src/main/java/io/github/ititus/data/pair/impl/IntIntPairImpl.java rename to src/main/java/io/github/ititus/commons/data/pair/impl/IntIntPairImpl.java index 8c8f60a..270a226 100644 --- a/src/main/java/io/github/ititus/data/pair/impl/IntIntPairImpl.java +++ b/src/main/java/io/github/ititus/commons/data/pair/impl/IntIntPairImpl.java @@ -1,7 +1,7 @@ -package io.github.ititus.data.pair.impl; +package io.github.ititus.commons.data.pair.impl; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.data.pair.IntIntPair; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.data.pair.IntIntPair; public final class IntIntPairImpl implements IntIntPair { diff --git a/src/main/java/io/github/ititus/data/pair/impl/IntObjPairImpl.java b/src/main/java/io/github/ititus/commons/data/pair/impl/IntObjPairImpl.java similarity index 86% rename from src/main/java/io/github/ititus/data/pair/impl/IntObjPairImpl.java rename to src/main/java/io/github/ititus/commons/data/pair/impl/IntObjPairImpl.java index 29fb999..bea590c 100644 --- a/src/main/java/io/github/ititus/data/pair/impl/IntObjPairImpl.java +++ b/src/main/java/io/github/ititus/commons/data/pair/impl/IntObjPairImpl.java @@ -1,7 +1,7 @@ -package io.github.ititus.data.pair.impl; +package io.github.ititus.commons.data.pair.impl; -import io.github.ititus.data.ObjectUtil; -import io.github.ititus.data.pair.IntObjPair; +import io.github.ititus.commons.data.ObjectUtil; +import io.github.ititus.commons.data.pair.IntObjPair; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/data/pair/impl/LongLongPairImpl.java b/src/main/java/io/github/ititus/commons/data/pair/impl/LongLongPairImpl.java similarity index 85% rename from src/main/java/io/github/ititus/data/pair/impl/LongLongPairImpl.java rename to src/main/java/io/github/ititus/commons/data/pair/impl/LongLongPairImpl.java index 97ef3cc..07434ac 100644 --- a/src/main/java/io/github/ititus/data/pair/impl/LongLongPairImpl.java +++ b/src/main/java/io/github/ititus/commons/data/pair/impl/LongLongPairImpl.java @@ -1,7 +1,7 @@ -package io.github.ititus.data.pair.impl; +package io.github.ititus.commons.data.pair.impl; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.data.pair.LongLongPair; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.data.pair.LongLongPair; public final class LongLongPairImpl implements LongLongPair { diff --git a/src/main/java/io/github/ititus/data/pair/impl/PairImpl.java b/src/main/java/io/github/ititus/commons/data/pair/impl/PairImpl.java similarity index 86% rename from src/main/java/io/github/ititus/data/pair/impl/PairImpl.java rename to src/main/java/io/github/ititus/commons/data/pair/impl/PairImpl.java index 6691494..a8249af 100644 --- a/src/main/java/io/github/ititus/data/pair/impl/PairImpl.java +++ b/src/main/java/io/github/ititus/commons/data/pair/impl/PairImpl.java @@ -1,7 +1,7 @@ -package io.github.ititus.data.pair.impl; +package io.github.ititus.commons.data.pair.impl; -import io.github.ititus.data.ObjectUtil; -import io.github.ititus.data.pair.Pair; +import io.github.ititus.commons.data.ObjectUtil; +import io.github.ititus.commons.data.pair.Pair; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/commons/exception/ExceptionUtil.java b/src/main/java/io/github/ititus/commons/exception/ExceptionUtil.java new file mode 100644 index 0000000..27e9e4b --- /dev/null +++ b/src/main/java/io/github/ititus/commons/exception/ExceptionUtil.java @@ -0,0 +1,35 @@ +package io.github.ititus.commons.exception; + +public final class ExceptionUtil { + + private ExceptionUtil() { + } + + public static void print(Throwable t) { + System.out.flush(); + System.err.flush(); + print(t, 0); + } + + private static void print(Throwable t, int indent) { + String msg = t.getLocalizedMessage(); + System.err.println(" ".repeat(indent) + t.getClass().getName() + (msg != null ? ": " + msg : "")); + + Throwable[] ss = t.getSuppressed(); + if (ss.length > 0) { + System.err.println(" ".repeat(indent) + "Suppressed (" + ss.length + "):"); + for (int i = 0, length = ss.length; i < length; i++) { + if (i > 0) { + System.err.println(); + } + + print(ss[i], indent + 1); + } + } + + if (t.getCause() != null) { + System.err.println(" ".repeat(indent) + "Caused by:"); + print(t.getCause(), indent + 1); + } + } +} diff --git a/src/main/java/io/github/ititus/function/BiIntObjConsumer.java b/src/main/java/io/github/ititus/commons/function/BiIntObjConsumer.java similarity index 88% rename from src/main/java/io/github/ititus/function/BiIntObjConsumer.java rename to src/main/java/io/github/ititus/commons/function/BiIntObjConsumer.java index 6216db0..96ad3e3 100644 --- a/src/main/java/io/github/ititus/function/BiIntObjConsumer.java +++ b/src/main/java/io/github/ititus/commons/function/BiIntObjConsumer.java @@ -1,4 +1,4 @@ -package io.github.ititus.function; +package io.github.ititus.commons.function; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/function/BiIntObjFunction.java b/src/main/java/io/github/ititus/commons/function/BiIntObjFunction.java similarity index 88% rename from src/main/java/io/github/ititus/function/BiIntObjFunction.java rename to src/main/java/io/github/ititus/commons/function/BiIntObjFunction.java index 16861c2..2273d01 100644 --- a/src/main/java/io/github/ititus/function/BiIntObjFunction.java +++ b/src/main/java/io/github/ititus/commons/function/BiIntObjFunction.java @@ -1,4 +1,4 @@ -package io.github.ititus.function; +package io.github.ititus.commons.function; import java.util.Objects; import java.util.function.Function; diff --git a/src/main/java/io/github/ititus/function/BiLongObjConsumer.java b/src/main/java/io/github/ititus/commons/function/BiLongObjConsumer.java similarity index 88% rename from src/main/java/io/github/ititus/function/BiLongObjConsumer.java rename to src/main/java/io/github/ititus/commons/function/BiLongObjConsumer.java index 75c7eb8..a81d734 100644 --- a/src/main/java/io/github/ititus/function/BiLongObjConsumer.java +++ b/src/main/java/io/github/ititus/commons/function/BiLongObjConsumer.java @@ -1,4 +1,4 @@ -package io.github.ititus.function; +package io.github.ititus.commons.function; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/function/BiLongObjFunction.java b/src/main/java/io/github/ititus/commons/function/BiLongObjFunction.java similarity index 88% rename from src/main/java/io/github/ititus/function/BiLongObjFunction.java rename to src/main/java/io/github/ititus/commons/function/BiLongObjFunction.java index ce154da..2cb992b 100644 --- a/src/main/java/io/github/ititus/function/BiLongObjFunction.java +++ b/src/main/java/io/github/ititus/commons/function/BiLongObjFunction.java @@ -1,4 +1,4 @@ -package io.github.ititus.function; +package io.github.ititus.commons.function; import java.util.Objects; import java.util.function.Function; diff --git a/src/main/java/io/github/ititus/function/BooleanFunction.java b/src/main/java/io/github/ititus/commons/function/BooleanFunction.java similarity index 68% rename from src/main/java/io/github/ititus/function/BooleanFunction.java rename to src/main/java/io/github/ititus/commons/function/BooleanFunction.java index 8869e04..65eab36 100644 --- a/src/main/java/io/github/ititus/function/BooleanFunction.java +++ b/src/main/java/io/github/ititus/commons/function/BooleanFunction.java @@ -1,4 +1,4 @@ -package io.github.ititus.function; +package io.github.ititus.commons.function; @FunctionalInterface public interface BooleanFunction { diff --git a/src/main/java/io/github/ititus/function/BooleanPredicate.java b/src/main/java/io/github/ititus/commons/function/BooleanPredicate.java similarity index 94% rename from src/main/java/io/github/ititus/function/BooleanPredicate.java rename to src/main/java/io/github/ititus/commons/function/BooleanPredicate.java index 30f0d8d..9ac9e34 100644 --- a/src/main/java/io/github/ititus/function/BooleanPredicate.java +++ b/src/main/java/io/github/ititus/commons/function/BooleanPredicate.java @@ -1,4 +1,4 @@ -package io.github.ititus.function; +package io.github.ititus.commons.function; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/function/ThrowingFunction.java b/src/main/java/io/github/ititus/commons/function/ThrowingFunction.java similarity index 93% rename from src/main/java/io/github/ititus/function/ThrowingFunction.java rename to src/main/java/io/github/ititus/commons/function/ThrowingFunction.java index 4005638..714b63a 100644 --- a/src/main/java/io/github/ititus/function/ThrowingFunction.java +++ b/src/main/java/io/github/ititus/commons/function/ThrowingFunction.java @@ -1,4 +1,4 @@ -package io.github.ititus.function; +package io.github.ititus.commons.function; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/internal/Config.java b/src/main/java/io/github/ititus/commons/internal/Config.java similarity index 93% rename from src/main/java/io/github/ititus/internal/Config.java rename to src/main/java/io/github/ititus/commons/internal/Config.java index 4210800..7d54385 100644 --- a/src/main/java/io/github/ititus/internal/Config.java +++ b/src/main/java/io/github/ititus/commons/internal/Config.java @@ -1,4 +1,4 @@ -package io.github.ititus.internal; +package io.github.ititus.commons.internal; public final class Config { diff --git a/src/main/java/io/github/ititus/io/BodyPublishers.java b/src/main/java/io/github/ititus/commons/io/BodyPublishers.java similarity index 96% rename from src/main/java/io/github/ititus/io/BodyPublishers.java rename to src/main/java/io/github/ititus/commons/io/BodyPublishers.java index b4fc135..238d53e 100644 --- a/src/main/java/io/github/ititus/io/BodyPublishers.java +++ b/src/main/java/io/github/ititus/commons/io/BodyPublishers.java @@ -1,4 +1,4 @@ -package io.github.ititus.io; +package io.github.ititus.commons.io; import java.net.URLEncoder; import java.net.http.HttpRequest.BodyPublisher; diff --git a/src/main/java/io/github/ititus/io/FileExtensionFilter.java b/src/main/java/io/github/ititus/commons/io/FileExtensionFilter.java similarity index 96% rename from src/main/java/io/github/ititus/io/FileExtensionFilter.java rename to src/main/java/io/github/ititus/commons/io/FileExtensionFilter.java index 47d6322..ed5171d 100644 --- a/src/main/java/io/github/ititus/io/FileExtensionFilter.java +++ b/src/main/java/io/github/ititus/commons/io/FileExtensionFilter.java @@ -1,4 +1,4 @@ -package io.github.ititus.io; +package io.github.ititus.commons.io; import java.nio.file.Path; import java.util.*; diff --git a/src/main/java/io/github/ititus/io/FileNameFilter.java b/src/main/java/io/github/ititus/commons/io/FileNameFilter.java similarity index 97% rename from src/main/java/io/github/ititus/io/FileNameFilter.java rename to src/main/java/io/github/ititus/commons/io/FileNameFilter.java index 58a80de..edfa4eb 100644 --- a/src/main/java/io/github/ititus/io/FileNameFilter.java +++ b/src/main/java/io/github/ititus/commons/io/FileNameFilter.java @@ -1,4 +1,4 @@ -package io.github.ititus.io; +package io.github.ititus.commons.io; import java.nio.file.Path; import java.util.Collection; diff --git a/src/main/java/io/github/ititus/io/HttpStatus.java b/src/main/java/io/github/ititus/commons/io/HttpStatus.java similarity index 98% rename from src/main/java/io/github/ititus/io/HttpStatus.java rename to src/main/java/io/github/ititus/commons/io/HttpStatus.java index 0c8a032..266fafa 100644 --- a/src/main/java/io/github/ititus/io/HttpStatus.java +++ b/src/main/java/io/github/ititus/commons/io/HttpStatus.java @@ -1,4 +1,4 @@ -package io.github.ititus.io; +package io.github.ititus.commons.io; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/io/github/ititus/io/HttpUtil.java b/src/main/java/io/github/ititus/commons/io/HttpUtil.java similarity index 95% rename from src/main/java/io/github/ititus/io/HttpUtil.java rename to src/main/java/io/github/ititus/commons/io/HttpUtil.java index 24ff794..e007fe1 100644 --- a/src/main/java/io/github/ititus/io/HttpUtil.java +++ b/src/main/java/io/github/ititus/commons/io/HttpUtil.java @@ -1,4 +1,4 @@ -package io.github.ititus.io; +package io.github.ititus.commons.io; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; @@ -31,5 +31,4 @@ public static String buildQueryString(Map params) { return query.toString(); } - } diff --git a/src/main/java/io/github/ititus/io/IO.java b/src/main/java/io/github/ititus/commons/io/IO.java similarity index 98% rename from src/main/java/io/github/ititus/io/IO.java rename to src/main/java/io/github/ititus/commons/io/IO.java index 5248a2f..343a1b4 100644 --- a/src/main/java/io/github/ititus/io/IO.java +++ b/src/main/java/io/github/ititus/commons/io/IO.java @@ -1,4 +1,4 @@ -package io.github.ititus.io; +package io.github.ititus.commons.io; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/io/github/ititus/io/PathFilter.java b/src/main/java/io/github/ititus/commons/io/PathFilter.java similarity index 96% rename from src/main/java/io/github/ititus/io/PathFilter.java rename to src/main/java/io/github/ititus/commons/io/PathFilter.java index 2a7c0a1..bcc21fa 100644 --- a/src/main/java/io/github/ititus/io/PathFilter.java +++ b/src/main/java/io/github/ititus/commons/io/PathFilter.java @@ -1,4 +1,4 @@ -package io.github.ititus.io; +package io.github.ititus.commons.io; import java.nio.file.Path; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/io/PathUtil.java b/src/main/java/io/github/ititus/commons/io/PathUtil.java similarity index 99% rename from src/main/java/io/github/ititus/io/PathUtil.java rename to src/main/java/io/github/ititus/commons/io/PathUtil.java index d9bdf96..586b18d 100644 --- a/src/main/java/io/github/ititus/io/PathUtil.java +++ b/src/main/java/io/github/ititus/commons/io/PathUtil.java @@ -1,4 +1,4 @@ -package io.github.ititus.io; +package io.github.ititus.commons.io; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/src/main/java/io/github/ititus/io/ZipUtil.java b/src/main/java/io/github/ititus/commons/io/ZipUtil.java similarity index 98% rename from src/main/java/io/github/ititus/io/ZipUtil.java rename to src/main/java/io/github/ititus/commons/io/ZipUtil.java index 1ae5a06..f801565 100644 --- a/src/main/java/io/github/ititus/io/ZipUtil.java +++ b/src/main/java/io/github/ititus/commons/io/ZipUtil.java @@ -1,4 +1,4 @@ -package io.github.ititus.io; +package io.github.ititus.commons.io; import java.io.IOException; import java.net.URI; diff --git a/src/main/java/io/github/ititus/math/base/Base64Converter.java b/src/main/java/io/github/ititus/commons/math/base/Base64Converter.java similarity index 92% rename from src/main/java/io/github/ititus/math/base/Base64Converter.java rename to src/main/java/io/github/ititus/commons/math/base/Base64Converter.java index 4c2c830..4284013 100644 --- a/src/main/java/io/github/ititus/math/base/Base64Converter.java +++ b/src/main/java/io/github/ititus/commons/math/base/Base64Converter.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.base; +package io.github.ititus.commons.math.base; import java.nio.charset.StandardCharsets; import java.util.Base64; diff --git a/src/main/java/io/github/ititus/math/base/BaseConverter.java b/src/main/java/io/github/ititus/commons/math/base/BaseConverter.java similarity index 97% rename from src/main/java/io/github/ititus/math/base/BaseConverter.java rename to src/main/java/io/github/ititus/commons/math/base/BaseConverter.java index f7e4403..42e1ebb 100644 --- a/src/main/java/io/github/ititus/math/base/BaseConverter.java +++ b/src/main/java/io/github/ititus/commons/math/base/BaseConverter.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.base; +package io.github.ititus.commons.math.base; -import io.github.ititus.math.number.BigIntegerMath; +import io.github.ititus.commons.math.number.BigIntegerMath; import java.math.BigInteger; diff --git a/src/main/java/io/github/ititus/math/base/BaseConverters.java b/src/main/java/io/github/ititus/commons/math/base/BaseConverters.java similarity index 77% rename from src/main/java/io/github/ititus/math/base/BaseConverters.java rename to src/main/java/io/github/ititus/commons/math/base/BaseConverters.java index 36ed335..b481a6d 100644 --- a/src/main/java/io/github/ititus/math/base/BaseConverters.java +++ b/src/main/java/io/github/ititus/commons/math/base/BaseConverters.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.base; +package io.github.ititus.commons.math.base; -import io.github.ititus.math.base.binary.BinaryConverter; +import io.github.ititus.commons.math.base.binary.BinaryConverter; public final class BaseConverters { diff --git a/src/main/java/io/github/ititus/math/base/HexConverter.java b/src/main/java/io/github/ititus/commons/math/base/HexConverter.java similarity index 94% rename from src/main/java/io/github/ititus/math/base/HexConverter.java rename to src/main/java/io/github/ititus/commons/math/base/HexConverter.java index 1f33471..e896148 100644 --- a/src/main/java/io/github/ititus/math/base/HexConverter.java +++ b/src/main/java/io/github/ititus/commons/math/base/HexConverter.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.base; +package io.github.ititus.commons.math.base; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/base/binary/BinaryConverter.java b/src/main/java/io/github/ititus/commons/math/base/binary/BinaryConverter.java similarity index 89% rename from src/main/java/io/github/ititus/math/base/binary/BinaryConverter.java rename to src/main/java/io/github/ititus/commons/math/base/binary/BinaryConverter.java index 386909c..eaaeff9 100644 --- a/src/main/java/io/github/ititus/math/base/binary/BinaryConverter.java +++ b/src/main/java/io/github/ititus/commons/math/base/binary/BinaryConverter.java @@ -1,13 +1,11 @@ -package io.github.ititus.math.base.binary; +package io.github.ititus.commons.math.base.binary; -import io.github.ititus.math.base.BaseConverter; +import io.github.ititus.commons.math.base.BaseConverter; +import io.github.ititus.commons.math.number.BigIntegerConstants; import java.math.BigInteger; import java.util.BitSet; -import static io.github.ititus.math.number.BigIntegerConstants.ONE; -import static io.github.ititus.math.number.BigIntegerConstants.ZERO; - public final class BinaryConverter extends BaseConverter { public static final BinaryConverter INSTANCE = new BinaryConverter(); @@ -107,8 +105,8 @@ public long decodeToLongUnsigned(BinaryNumber bn) { } public BigInteger decodeToBigIntegerUnsigned(BinaryNumber bn) { - BigInteger n = ZERO; - BigInteger b = ONE; + BigInteger n = BigIntegerConstants.ZERO; + BigInteger b = BigIntegerConstants.ONE; for (int i = 0; i < bn.getLength(); i++) { if (bn.get(i)) { diff --git a/src/main/java/io/github/ititus/math/base/binary/BinaryNumber.java b/src/main/java/io/github/ititus/commons/math/base/binary/BinaryNumber.java similarity index 99% rename from src/main/java/io/github/ititus/math/base/binary/BinaryNumber.java rename to src/main/java/io/github/ititus/commons/math/base/binary/BinaryNumber.java index eaa963a..da73bbe 100644 --- a/src/main/java/io/github/ititus/math/base/binary/BinaryNumber.java +++ b/src/main/java/io/github/ititus/commons/math/base/binary/BinaryNumber.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.base.binary; +package io.github.ititus.commons.math.base.binary; import java.util.Arrays; import java.util.BitSet; diff --git a/src/main/java/io/github/ititus/math/base/binary/BinaryPermutations.java b/src/main/java/io/github/ititus/commons/math/base/binary/BinaryPermutations.java similarity index 96% rename from src/main/java/io/github/ititus/math/base/binary/BinaryPermutations.java rename to src/main/java/io/github/ititus/commons/math/base/binary/BinaryPermutations.java index 20adee8..c552c5a 100644 --- a/src/main/java/io/github/ititus/math/base/binary/BinaryPermutations.java +++ b/src/main/java/io/github/ititus/commons/math/base/binary/BinaryPermutations.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.base.binary; +package io.github.ititus.commons.math.base.binary; import java.util.ArrayList; import java.util.Collections; diff --git a/src/main/java/io/github/ititus/math/base/binary/HammingDistance.java b/src/main/java/io/github/ititus/commons/math/base/binary/HammingDistance.java similarity index 96% rename from src/main/java/io/github/ititus/math/base/binary/HammingDistance.java rename to src/main/java/io/github/ititus/commons/math/base/binary/HammingDistance.java index ddd0dac..acd580b 100644 --- a/src/main/java/io/github/ititus/math/base/binary/HammingDistance.java +++ b/src/main/java/io/github/ititus/commons/math/base/binary/HammingDistance.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.base.binary; +package io.github.ititus.commons.math.base.binary; public final class HammingDistance { diff --git a/src/main/java/io/github/ititus/math/base/binary/QFixedPoint.java b/src/main/java/io/github/ititus/commons/math/base/binary/QFixedPoint.java similarity index 85% rename from src/main/java/io/github/ititus/math/base/binary/QFixedPoint.java rename to src/main/java/io/github/ititus/commons/math/base/binary/QFixedPoint.java index f7126d2..4f723e1 100644 --- a/src/main/java/io/github/ititus/math/base/binary/QFixedPoint.java +++ b/src/main/java/io/github/ititus/commons/math/base/binary/QFixedPoint.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.base.binary; +package io.github.ititus.commons.math.base.binary; -import io.github.ititus.math.number.BigRational; -import io.github.ititus.math.number.BigRationalConstants; +import io.github.ititus.commons.math.number.BigRational; +import io.github.ititus.commons.math.number.BigRationalConstants; import java.math.BigInteger; diff --git a/src/main/java/io/github/ititus/math/base/binary/TwosComplement.java b/src/main/java/io/github/ititus/commons/math/base/binary/TwosComplement.java similarity index 97% rename from src/main/java/io/github/ititus/math/base/binary/TwosComplement.java rename to src/main/java/io/github/ititus/commons/math/base/binary/TwosComplement.java index f9f5e0d..b6ac4f0 100644 --- a/src/main/java/io/github/ititus/math/base/binary/TwosComplement.java +++ b/src/main/java/io/github/ititus/commons/math/base/binary/TwosComplement.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.base.binary; +package io.github.ititus.commons.math.base.binary; -import io.github.ititus.math.base.BaseConverters; +import io.github.ititus.commons.math.base.BaseConverters; import java.math.BigInteger; diff --git a/src/main/java/io/github/ititus/math/calculation/ComplexNewton.java b/src/main/java/io/github/ititus/commons/math/calculation/ComplexNewton.java similarity index 87% rename from src/main/java/io/github/ititus/math/calculation/ComplexNewton.java rename to src/main/java/io/github/ititus/commons/math/calculation/ComplexNewton.java index 4f87856..b8572ed 100644 --- a/src/main/java/io/github/ititus/math/calculation/ComplexNewton.java +++ b/src/main/java/io/github/ititus/commons/math/calculation/ComplexNewton.java @@ -1,10 +1,10 @@ -package io.github.ititus.math.calculation; +package io.github.ititus.commons.math.calculation; -import io.github.ititus.math.function.ComplexFunction; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.number.BigComplexConstants; -import io.github.ititus.math.number.BigRational; -import io.github.ititus.math.number.BigRationalConstants; +import io.github.ititus.commons.math.function.ComplexFunction; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplexConstants; +import io.github.ititus.commons.math.number.BigRational; +import io.github.ititus.commons.math.number.BigRationalConstants; import java.util.function.UnaryOperator; @@ -21,7 +21,7 @@ public class ComplexNewton { private BigComplex initialValue; private int maxIterations; private BigRational absTolSquared; - private BigRational relTolSquared; + private final BigRational relTolSquared; private ComplexNewton(UnaryOperator function, UnaryOperator derivative) { this.function = function; diff --git a/src/main/java/io/github/ititus/math/calculation/DoubleNewton.java b/src/main/java/io/github/ititus/commons/math/calculation/DoubleNewton.java similarity index 96% rename from src/main/java/io/github/ititus/math/calculation/DoubleNewton.java rename to src/main/java/io/github/ititus/commons/math/calculation/DoubleNewton.java index 70924b8..d2653ff 100644 --- a/src/main/java/io/github/ititus/math/calculation/DoubleNewton.java +++ b/src/main/java/io/github/ititus/commons/math/calculation/DoubleNewton.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.calculation; +package io.github.ititus.commons.math.calculation; import java.util.function.DoubleUnaryOperator; @@ -15,7 +15,7 @@ public class DoubleNewton { private double initialValue; private int maxIterations; private double absTol; - private double relTol; + private final double relTol; private DoubleNewton(DoubleUnaryOperator function, DoubleUnaryOperator derivative) { this.function = function; diff --git a/src/main/java/io/github/ititus/math/calculation/NewtonApproximator.java b/src/main/java/io/github/ititus/commons/math/calculation/NewtonApproximator.java similarity index 85% rename from src/main/java/io/github/ititus/math/calculation/NewtonApproximator.java rename to src/main/java/io/github/ititus/commons/math/calculation/NewtonApproximator.java index 92e7ff5..7802593 100644 --- a/src/main/java/io/github/ititus/math/calculation/NewtonApproximator.java +++ b/src/main/java/io/github/ititus/commons/math/calculation/NewtonApproximator.java @@ -1,12 +1,12 @@ -package io.github.ititus.math.calculation; +package io.github.ititus.commons.math.calculation; -import io.github.ititus.math.number.BigRational; +import io.github.ititus.commons.math.number.BigRational; import java.math.MathContext; -import static io.github.ititus.math.number.BigRational.of; -import static io.github.ititus.math.number.BigRational.ofExp; -import static io.github.ititus.math.number.BigRationalConstants.ONE; +import static io.github.ititus.commons.math.number.BigRational.of; +import static io.github.ititus.commons.math.number.BigRational.ofExp; +import static io.github.ititus.commons.math.number.BigRationalConstants.ONE; public class NewtonApproximator { diff --git a/src/main/java/io/github/ititus/math/calculation/PowerSeriesCalculator.java b/src/main/java/io/github/ititus/commons/math/calculation/PowerSeriesCalculator.java similarity index 94% rename from src/main/java/io/github/ititus/math/calculation/PowerSeriesCalculator.java rename to src/main/java/io/github/ititus/commons/math/calculation/PowerSeriesCalculator.java index ecda662..fdaf825 100644 --- a/src/main/java/io/github/ititus/math/calculation/PowerSeriesCalculator.java +++ b/src/main/java/io/github/ititus/commons/math/calculation/PowerSeriesCalculator.java @@ -1,9 +1,9 @@ -package io.github.ititus.math.calculation; +package io.github.ititus.commons.math.calculation; -import io.github.ititus.math.number.BigIntegerConstants; -import io.github.ititus.math.number.BigIntegerMath; -import io.github.ititus.math.number.BigRational; -import io.github.ititus.math.number.BigRationalConstants; +import io.github.ititus.commons.math.number.BigIntegerConstants; +import io.github.ititus.commons.math.number.BigIntegerMath; +import io.github.ititus.commons.math.number.BigRational; +import io.github.ititus.commons.math.number.BigRationalConstants; import java.math.BigInteger; import java.math.MathContext; @@ -11,8 +11,8 @@ import java.util.HashMap; import java.util.Map; -import static io.github.ititus.math.number.BigRationalConstants.ONE; -import static io.github.ititus.math.number.BigRationalConstants.ZERO; +import static io.github.ititus.commons.math.number.BigRationalConstants.ONE; +import static io.github.ititus.commons.math.number.BigRationalConstants.ZERO; public final class PowerSeriesCalculator { diff --git a/src/main/java/io/github/ititus/math/expression/ComplexEvaluationContext.java b/src/main/java/io/github/ititus/commons/math/expression/ComplexEvaluationContext.java similarity index 95% rename from src/main/java/io/github/ititus/math/expression/ComplexEvaluationContext.java rename to src/main/java/io/github/ititus/commons/math/expression/ComplexEvaluationContext.java index dd6f9a4..0670001 100644 --- a/src/main/java/io/github/ititus/math/expression/ComplexEvaluationContext.java +++ b/src/main/java/io/github/ititus/commons/math/expression/ComplexEvaluationContext.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.expression; +package io.github.ititus.commons.math.expression; -import io.github.ititus.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplex; import java.util.*; diff --git a/src/main/java/io/github/ititus/math/expression/Expression.java b/src/main/java/io/github/ititus/commons/math/expression/Expression.java similarity index 77% rename from src/main/java/io/github/ititus/math/expression/Expression.java rename to src/main/java/io/github/ititus/commons/math/expression/Expression.java index 303e192..3721b53 100644 --- a/src/main/java/io/github/ititus/math/expression/Expression.java +++ b/src/main/java/io/github/ititus/commons/math/expression/Expression.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.expression; +package io.github.ititus.commons.math.expression; -import io.github.ititus.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplex; public abstract class Expression { diff --git a/src/main/java/io/github/ititus/math/expression/FunctionAdapter.java b/src/main/java/io/github/ititus/commons/math/expression/FunctionAdapter.java similarity index 84% rename from src/main/java/io/github/ititus/math/expression/FunctionAdapter.java rename to src/main/java/io/github/ititus/commons/math/expression/FunctionAdapter.java index cd79789..6b02e24 100644 --- a/src/main/java/io/github/ititus/math/expression/FunctionAdapter.java +++ b/src/main/java/io/github/ititus/commons/math/expression/FunctionAdapter.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.expression; +package io.github.ititus.commons.math.expression; -import io.github.ititus.math.function.ComplexFunction; -import io.github.ititus.math.number.BigComplex; +import io.github.ititus.commons.math.function.ComplexFunction; +import io.github.ititus.commons.math.number.BigComplex; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/expression/Identity.java b/src/main/java/io/github/ititus/commons/math/expression/Identity.java similarity index 88% rename from src/main/java/io/github/ititus/math/expression/Identity.java rename to src/main/java/io/github/ititus/commons/math/expression/Identity.java index d01b706..96d7564 100644 --- a/src/main/java/io/github/ititus/math/expression/Identity.java +++ b/src/main/java/io/github/ititus/commons/math/expression/Identity.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.expression; +package io.github.ititus.commons.math.expression; -import io.github.ititus.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplex; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/expression/Variable.java b/src/main/java/io/github/ititus/commons/math/expression/Variable.java similarity index 97% rename from src/main/java/io/github/ititus/math/expression/Variable.java rename to src/main/java/io/github/ititus/commons/math/expression/Variable.java index 293dfec..dd6efa9 100644 --- a/src/main/java/io/github/ititus/math/expression/Variable.java +++ b/src/main/java/io/github/ititus/commons/math/expression/Variable.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.expression; +package io.github.ititus.commons.math.expression; import java.util.Objects; import java.util.regex.Pattern; diff --git a/src/main/java/io/github/ititus/math/function/ComplexFunction.java b/src/main/java/io/github/ititus/commons/math/function/ComplexFunction.java similarity index 82% rename from src/main/java/io/github/ititus/math/function/ComplexFunction.java rename to src/main/java/io/github/ititus/commons/math/function/ComplexFunction.java index 98770e7..b83c37b 100644 --- a/src/main/java/io/github/ititus/math/function/ComplexFunction.java +++ b/src/main/java/io/github/ititus/commons/math/function/ComplexFunction.java @@ -1,10 +1,10 @@ -package io.github.ititus.math.function; +package io.github.ititus.commons.math.function; -import io.github.ititus.math.expression.Variable; -import io.github.ititus.math.number.BigComplex; +import io.github.ititus.commons.math.expression.Variable; +import io.github.ititus.commons.math.number.BigComplex; -import static io.github.ititus.math.number.BigComplexConstants.ONE; -import static io.github.ititus.math.number.BigComplexConstants.ZERO; +import static io.github.ititus.commons.math.number.BigComplexConstants.ONE; +import static io.github.ititus.commons.math.number.BigComplexConstants.ZERO; public abstract class ComplexFunction { diff --git a/src/main/java/io/github/ititus/math/function/Identity.java b/src/main/java/io/github/ititus/commons/math/function/Identity.java similarity index 83% rename from src/main/java/io/github/ititus/math/function/Identity.java rename to src/main/java/io/github/ititus/commons/math/function/Identity.java index c11ed44..fea5a8f 100644 --- a/src/main/java/io/github/ititus/math/function/Identity.java +++ b/src/main/java/io/github/ititus/commons/math/function/Identity.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.function; +package io.github.ititus.commons.math.function; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; public final class Identity extends ComplexFunction { diff --git a/src/main/java/io/github/ititus/math/function/Power.java b/src/main/java/io/github/ititus/commons/math/function/Power.java similarity index 92% rename from src/main/java/io/github/ititus/math/function/Power.java rename to src/main/java/io/github/ititus/commons/math/function/Power.java index d618df6..4271aae 100644 --- a/src/main/java/io/github/ititus/math/function/Power.java +++ b/src/main/java/io/github/ititus/commons/math/function/Power.java @@ -1,14 +1,14 @@ -package io.github.ititus.math.function; +package io.github.ititus.commons.math.function; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.function.exponential.Log; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.number.BigRational; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.function.exponential.Log; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigRational; import java.util.Objects; import java.util.stream.IntStream; -import static io.github.ititus.math.number.BigComplexConstants.ONE; +import static io.github.ititus.commons.math.number.BigComplexConstants.ONE; public final class Power extends ComplexFunction { diff --git a/src/main/java/io/github/ititus/math/function/Product.java b/src/main/java/io/github/ititus/commons/math/function/Product.java similarity index 91% rename from src/main/java/io/github/ititus/math/function/Product.java rename to src/main/java/io/github/ititus/commons/math/function/Product.java index 7c69b3f..e720df2 100644 --- a/src/main/java/io/github/ititus/math/function/Product.java +++ b/src/main/java/io/github/ititus/commons/math/function/Product.java @@ -1,15 +1,15 @@ -package io.github.ititus.math.function; +package io.github.ititus.commons.math.function; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.permutation.Permutations; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.permutation.Permutations; import java.util.Arrays; import java.util.stream.Collectors; import java.util.stream.Stream; -import static io.github.ititus.math.number.BigComplexConstants.ONE; -import static io.github.ititus.math.number.BigComplexConstants.ZERO; +import static io.github.ititus.commons.math.number.BigComplexConstants.ONE; +import static io.github.ititus.commons.math.number.BigComplexConstants.ZERO; import static java.util.function.Predicate.not; public final class Product extends ComplexFunction { diff --git a/src/main/java/io/github/ititus/math/function/Rational.java b/src/main/java/io/github/ititus/commons/math/function/Rational.java similarity index 92% rename from src/main/java/io/github/ititus/math/function/Rational.java rename to src/main/java/io/github/ititus/commons/math/function/Rational.java index 4bb1fb0..d24497c 100644 --- a/src/main/java/io/github/ititus/math/function/Rational.java +++ b/src/main/java/io/github/ititus/commons/math/function/Rational.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.function; +package io.github.ititus.commons.math.function; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/function/Sum.java b/src/main/java/io/github/ititus/commons/math/function/Sum.java similarity index 92% rename from src/main/java/io/github/ititus/math/function/Sum.java rename to src/main/java/io/github/ititus/commons/math/function/Sum.java index c9406df..32a04d1 100644 --- a/src/main/java/io/github/ititus/math/function/Sum.java +++ b/src/main/java/io/github/ititus/commons/math/function/Sum.java @@ -1,14 +1,14 @@ -package io.github.ititus.math.function; +package io.github.ititus.commons.math.function; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; -import static io.github.ititus.math.number.BigComplexConstants.ONE; -import static io.github.ititus.math.number.BigComplexConstants.ZERO; +import static io.github.ititus.commons.math.number.BigComplexConstants.ONE; +import static io.github.ititus.commons.math.number.BigComplexConstants.ZERO; import static java.util.function.Predicate.not; public final class Sum extends ComplexFunction { @@ -99,7 +99,7 @@ public BigComplex evaluate(BigComplex z) { @Override protected ComplexFunction derivative0(int n) { - return Sum.of(Arrays.stream(terms) + return of(Arrays.stream(terms) .map(f -> f.derivative(n)) .toArray(ComplexFunction[]::new)); } diff --git a/src/main/java/io/github/ititus/math/function/constant/Constant.java b/src/main/java/io/github/ititus/commons/math/function/constant/Constant.java similarity index 90% rename from src/main/java/io/github/ititus/math/function/constant/Constant.java rename to src/main/java/io/github/ititus/commons/math/function/constant/Constant.java index ae25e5c..a82e42d 100644 --- a/src/main/java/io/github/ititus/math/function/constant/Constant.java +++ b/src/main/java/io/github/ititus/commons/math/function/constant/Constant.java @@ -1,10 +1,10 @@ -package io.github.ititus.math.function.constant; +package io.github.ititus.commons.math.function.constant; -import io.github.ititus.math.function.ComplexFunction; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.number.BigComplexConstants; -import io.github.ititus.math.number.BigIntegerMath; -import io.github.ititus.math.number.BigRational; +import io.github.ititus.commons.math.function.ComplexFunction; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplexConstants; +import io.github.ititus.commons.math.number.BigIntegerMath; +import io.github.ititus.commons.math.number.BigRational; import java.math.BigInteger; import java.util.Arrays; diff --git a/src/main/java/io/github/ititus/math/function/exponential/Exp.java b/src/main/java/io/github/ititus/commons/math/function/exponential/Exp.java similarity index 76% rename from src/main/java/io/github/ititus/math/function/exponential/Exp.java rename to src/main/java/io/github/ititus/commons/math/function/exponential/Exp.java index 5e107c5..2c32ce4 100644 --- a/src/main/java/io/github/ititus/math/function/exponential/Exp.java +++ b/src/main/java/io/github/ititus/commons/math/function/exponential/Exp.java @@ -1,11 +1,11 @@ -package io.github.ititus.math.function.exponential; +package io.github.ititus.commons.math.function.exponential; -import io.github.ititus.math.function.ComplexFunction; -import io.github.ititus.math.function.Identity; -import io.github.ititus.math.function.Product; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.number.BigComplexMath; +import io.github.ititus.commons.math.function.ComplexFunction; +import io.github.ititus.commons.math.function.Identity; +import io.github.ititus.commons.math.function.Product; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplexMath; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/function/exponential/Log.java b/src/main/java/io/github/ititus/commons/math/function/exponential/Log.java similarity index 77% rename from src/main/java/io/github/ititus/math/function/exponential/Log.java rename to src/main/java/io/github/ititus/commons/math/function/exponential/Log.java index 63f4330..0b40ddb 100644 --- a/src/main/java/io/github/ititus/math/function/exponential/Log.java +++ b/src/main/java/io/github/ititus/commons/math/function/exponential/Log.java @@ -1,10 +1,10 @@ -package io.github.ititus.math.function.exponential; +package io.github.ititus.commons.math.function.exponential; -import io.github.ititus.math.function.ComplexFunction; -import io.github.ititus.math.function.Identity; -import io.github.ititus.math.function.Rational; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; +import io.github.ititus.commons.math.function.ComplexFunction; +import io.github.ititus.commons.math.function.Identity; +import io.github.ititus.commons.math.function.Rational; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/function/hyperbolic/Cosh.java b/src/main/java/io/github/ititus/commons/math/function/hyperbolic/Cosh.java similarity index 79% rename from src/main/java/io/github/ititus/math/function/hyperbolic/Cosh.java rename to src/main/java/io/github/ititus/commons/math/function/hyperbolic/Cosh.java index db00bab..001f8a7 100644 --- a/src/main/java/io/github/ititus/math/function/hyperbolic/Cosh.java +++ b/src/main/java/io/github/ititus/commons/math/function/hyperbolic/Cosh.java @@ -1,11 +1,11 @@ -package io.github.ititus.math.function.hyperbolic; +package io.github.ititus.commons.math.function.hyperbolic; -import io.github.ititus.math.function.ComplexFunction; -import io.github.ititus.math.function.Identity; -import io.github.ititus.math.function.Product; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.number.BigComplexMath; +import io.github.ititus.commons.math.function.ComplexFunction; +import io.github.ititus.commons.math.function.Identity; +import io.github.ititus.commons.math.function.Product; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplexMath; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/function/hyperbolic/Sinh.java b/src/main/java/io/github/ititus/commons/math/function/hyperbolic/Sinh.java similarity index 79% rename from src/main/java/io/github/ititus/math/function/hyperbolic/Sinh.java rename to src/main/java/io/github/ititus/commons/math/function/hyperbolic/Sinh.java index bc77a9c..55f99b9 100644 --- a/src/main/java/io/github/ititus/math/function/hyperbolic/Sinh.java +++ b/src/main/java/io/github/ititus/commons/math/function/hyperbolic/Sinh.java @@ -1,11 +1,11 @@ -package io.github.ititus.math.function.hyperbolic; +package io.github.ititus.commons.math.function.hyperbolic; -import io.github.ititus.math.function.ComplexFunction; -import io.github.ititus.math.function.Identity; -import io.github.ititus.math.function.Product; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.number.BigComplexMath; +import io.github.ititus.commons.math.function.ComplexFunction; +import io.github.ititus.commons.math.function.Identity; +import io.github.ititus.commons.math.function.Product; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplexMath; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/function/hyperbolic/Tanh.java b/src/main/java/io/github/ititus/commons/math/function/hyperbolic/Tanh.java similarity index 82% rename from src/main/java/io/github/ititus/math/function/hyperbolic/Tanh.java rename to src/main/java/io/github/ititus/commons/math/function/hyperbolic/Tanh.java index 9932450..603b27d 100644 --- a/src/main/java/io/github/ititus/math/function/hyperbolic/Tanh.java +++ b/src/main/java/io/github/ititus/commons/math/function/hyperbolic/Tanh.java @@ -1,9 +1,9 @@ -package io.github.ititus.math.function.hyperbolic; +package io.github.ititus.commons.math.function.hyperbolic; -import io.github.ititus.math.function.*; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.number.BigComplexMath; +import io.github.ititus.commons.math.function.*; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplexMath; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/function/polynomial/Polynomial.java b/src/main/java/io/github/ititus/commons/math/function/polynomial/Polynomial.java similarity index 85% rename from src/main/java/io/github/ititus/math/function/polynomial/Polynomial.java rename to src/main/java/io/github/ititus/commons/math/function/polynomial/Polynomial.java index d12abe9..82f4d1c 100644 --- a/src/main/java/io/github/ititus/math/function/polynomial/Polynomial.java +++ b/src/main/java/io/github/ititus/commons/math/function/polynomial/Polynomial.java @@ -1,8 +1,8 @@ -package io.github.ititus.math.function.polynomial; +package io.github.ititus.commons.math.function.polynomial; -import io.github.ititus.math.function.*; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; +import io.github.ititus.commons.math.function.*; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; import java.util.ArrayList; import java.util.Arrays; diff --git a/src/main/java/io/github/ititus/math/function/trigonometric/Cos.java b/src/main/java/io/github/ititus/commons/math/function/trigonometric/Cos.java similarity index 81% rename from src/main/java/io/github/ititus/math/function/trigonometric/Cos.java rename to src/main/java/io/github/ititus/commons/math/function/trigonometric/Cos.java index df5b358..04f3434 100644 --- a/src/main/java/io/github/ititus/math/function/trigonometric/Cos.java +++ b/src/main/java/io/github/ititus/commons/math/function/trigonometric/Cos.java @@ -1,11 +1,11 @@ -package io.github.ititus.math.function.trigonometric; +package io.github.ititus.commons.math.function.trigonometric; -import io.github.ititus.math.function.ComplexFunction; -import io.github.ititus.math.function.Identity; -import io.github.ititus.math.function.Product; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.number.BigComplexMath; +import io.github.ititus.commons.math.function.ComplexFunction; +import io.github.ititus.commons.math.function.Identity; +import io.github.ititus.commons.math.function.Product; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplexMath; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/function/trigonometric/Sin.java b/src/main/java/io/github/ititus/commons/math/function/trigonometric/Sin.java similarity index 81% rename from src/main/java/io/github/ititus/math/function/trigonometric/Sin.java rename to src/main/java/io/github/ititus/commons/math/function/trigonometric/Sin.java index f45384a..f43521f 100644 --- a/src/main/java/io/github/ititus/math/function/trigonometric/Sin.java +++ b/src/main/java/io/github/ititus/commons/math/function/trigonometric/Sin.java @@ -1,11 +1,11 @@ -package io.github.ititus.math.function.trigonometric; +package io.github.ititus.commons.math.function.trigonometric; -import io.github.ititus.math.function.ComplexFunction; -import io.github.ititus.math.function.Identity; -import io.github.ititus.math.function.Product; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.number.BigComplexMath; +import io.github.ititus.commons.math.function.ComplexFunction; +import io.github.ititus.commons.math.function.Identity; +import io.github.ititus.commons.math.function.Product; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplexMath; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/function/trigonometric/Tan.java b/src/main/java/io/github/ititus/commons/math/function/trigonometric/Tan.java similarity index 82% rename from src/main/java/io/github/ititus/math/function/trigonometric/Tan.java rename to src/main/java/io/github/ititus/commons/math/function/trigonometric/Tan.java index f7e180a..17a1a2e 100644 --- a/src/main/java/io/github/ititus/math/function/trigonometric/Tan.java +++ b/src/main/java/io/github/ititus/commons/math/function/trigonometric/Tan.java @@ -1,9 +1,9 @@ -package io.github.ititus.math.function.trigonometric; +package io.github.ititus.commons.math.function.trigonometric; -import io.github.ititus.math.function.*; -import io.github.ititus.math.function.constant.Constant; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.number.BigComplexMath; +import io.github.ititus.commons.math.function.*; +import io.github.ititus.commons.math.function.constant.Constant; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigComplexMath; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/graph/DiGraph.java b/src/main/java/io/github/ititus/commons/math/graph/DiGraph.java similarity index 94% rename from src/main/java/io/github/ititus/math/graph/DiGraph.java rename to src/main/java/io/github/ititus/commons/math/graph/DiGraph.java index 545d49a..56cd661 100644 --- a/src/main/java/io/github/ititus/math/graph/DiGraph.java +++ b/src/main/java/io/github/ititus/commons/math/graph/DiGraph.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.graph; +package io.github.ititus.commons.math.graph; -import io.github.ititus.math.number.BigRational; -import io.github.ititus.math.number.BigRationalConstants; +import io.github.ititus.commons.math.number.BigRational; +import io.github.ititus.commons.math.number.BigRationalConstants; import java.util.*; diff --git a/src/main/java/io/github/ititus/math/graph/Edge.java b/src/main/java/io/github/ititus/commons/math/graph/Edge.java similarity index 88% rename from src/main/java/io/github/ititus/math/graph/Edge.java rename to src/main/java/io/github/ititus/commons/math/graph/Edge.java index f24273f..d6d9c92 100644 --- a/src/main/java/io/github/ititus/math/graph/Edge.java +++ b/src/main/java/io/github/ititus/commons/math/graph/Edge.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.graph; +package io.github.ititus.commons.math.graph; -import io.github.ititus.math.number.BigRational; -import io.github.ititus.math.number.BigRationalConstants; +import io.github.ititus.commons.math.number.BigRational; +import io.github.ititus.commons.math.number.BigRationalConstants; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/graph/Graph.java b/src/main/java/io/github/ititus/commons/math/graph/Graph.java similarity index 95% rename from src/main/java/io/github/ititus/math/graph/Graph.java rename to src/main/java/io/github/ititus/commons/math/graph/Graph.java index f0c6237..8cd4683 100644 --- a/src/main/java/io/github/ititus/math/graph/Graph.java +++ b/src/main/java/io/github/ititus/commons/math/graph/Graph.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.graph; +package io.github.ititus.commons.math.graph; -import io.github.ititus.math.number.BigRational; -import io.github.ititus.math.number.BigRationalConstants; +import io.github.ititus.commons.math.number.BigRational; +import io.github.ititus.commons.math.number.BigRationalConstants; import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/io/github/ititus/math/graph/Vertex.java b/src/main/java/io/github/ititus/commons/math/graph/Vertex.java similarity index 97% rename from src/main/java/io/github/ititus/math/graph/Vertex.java rename to src/main/java/io/github/ititus/commons/math/graph/Vertex.java index ee8d305..eca71ee 100644 --- a/src/main/java/io/github/ititus/math/graph/Vertex.java +++ b/src/main/java/io/github/ititus/commons/math/graph/Vertex.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.graph; +package io.github.ititus.commons.math.graph; import java.util.*; diff --git a/src/main/java/io/github/ititus/math/graph/algorithm/DiDijkstra.java b/src/main/java/io/github/ititus/commons/math/graph/algorithm/DiDijkstra.java similarity index 92% rename from src/main/java/io/github/ititus/math/graph/algorithm/DiDijkstra.java rename to src/main/java/io/github/ititus/commons/math/graph/algorithm/DiDijkstra.java index 5eaaef1..c0ee8d8 100644 --- a/src/main/java/io/github/ititus/math/graph/algorithm/DiDijkstra.java +++ b/src/main/java/io/github/ititus/commons/math/graph/algorithm/DiDijkstra.java @@ -1,11 +1,11 @@ -package io.github.ititus.math.graph.algorithm; - -import io.github.ititus.data.pair.Pair; -import io.github.ititus.math.graph.DiGraph; -import io.github.ititus.math.graph.Edge; -import io.github.ititus.math.graph.Vertex; -import io.github.ititus.math.number.BigRational; -import io.github.ititus.math.number.BigRationalConstants; +package io.github.ititus.commons.math.graph.algorithm; + +import io.github.ititus.commons.data.pair.Pair; +import io.github.ititus.commons.math.graph.DiGraph; +import io.github.ititus.commons.math.graph.Edge; +import io.github.ititus.commons.math.graph.Vertex; +import io.github.ititus.commons.math.number.BigRational; +import io.github.ititus.commons.math.number.BigRationalConstants; import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/io/github/ititus/math/graph/algorithm/Dijkstra.java b/src/main/java/io/github/ititus/commons/math/graph/algorithm/Dijkstra.java similarity index 92% rename from src/main/java/io/github/ititus/math/graph/algorithm/Dijkstra.java rename to src/main/java/io/github/ititus/commons/math/graph/algorithm/Dijkstra.java index 6f4e1a8..7096b99 100644 --- a/src/main/java/io/github/ititus/math/graph/algorithm/Dijkstra.java +++ b/src/main/java/io/github/ititus/commons/math/graph/algorithm/Dijkstra.java @@ -1,11 +1,11 @@ -package io.github.ititus.math.graph.algorithm; - -import io.github.ititus.data.pair.Pair; -import io.github.ititus.math.graph.Edge; -import io.github.ititus.math.graph.Graph; -import io.github.ititus.math.graph.Vertex; -import io.github.ititus.math.number.BigRational; -import io.github.ititus.math.number.BigRationalConstants; +package io.github.ititus.commons.math.graph.algorithm; + +import io.github.ititus.commons.data.pair.Pair; +import io.github.ititus.commons.math.graph.Edge; +import io.github.ititus.commons.math.graph.Graph; +import io.github.ititus.commons.math.graph.Vertex; +import io.github.ititus.commons.math.number.BigRational; +import io.github.ititus.commons.math.number.BigRationalConstants; import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/io/github/ititus/math/hash/Hash.java b/src/main/java/io/github/ititus/commons/math/hash/Hash.java similarity index 97% rename from src/main/java/io/github/ititus/math/hash/Hash.java rename to src/main/java/io/github/ititus/commons/math/hash/Hash.java index f69fa5c..45cb120 100644 --- a/src/main/java/io/github/ititus/math/hash/Hash.java +++ b/src/main/java/io/github/ititus/commons/math/hash/Hash.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.hash; +package io.github.ititus.commons.math.hash; import java.nio.ByteBuffer; import java.nio.charset.Charset; diff --git a/src/main/java/io/github/ititus/math/hash/HashBuilder.java b/src/main/java/io/github/ititus/commons/math/hash/HashBuilder.java similarity index 97% rename from src/main/java/io/github/ititus/math/hash/HashBuilder.java rename to src/main/java/io/github/ititus/commons/math/hash/HashBuilder.java index 21c5717..5c26c4d 100644 --- a/src/main/java/io/github/ititus/math/hash/HashBuilder.java +++ b/src/main/java/io/github/ititus/commons/math/hash/HashBuilder.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.hash; +package io.github.ititus.commons.math.hash; import java.nio.ByteBuffer; import java.nio.charset.Charset; diff --git a/src/main/java/io/github/ititus/math/hash/HashResult.java b/src/main/java/io/github/ititus/commons/math/hash/HashResult.java similarity index 81% rename from src/main/java/io/github/ititus/math/hash/HashResult.java rename to src/main/java/io/github/ititus/commons/math/hash/HashResult.java index b40e23f..6c373e4 100644 --- a/src/main/java/io/github/ititus/math/hash/HashResult.java +++ b/src/main/java/io/github/ititus/commons/math/hash/HashResult.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.hash; +package io.github.ititus.commons.math.hash; -import io.github.ititus.math.base.BaseConverters; +import io.github.ititus.commons.math.base.BaseConverters; import java.util.Arrays; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/hash/Hashing.java b/src/main/java/io/github/ititus/commons/math/hash/Hashing.java similarity index 79% rename from src/main/java/io/github/ititus/math/hash/Hashing.java rename to src/main/java/io/github/ititus/commons/math/hash/Hashing.java index 6f195ba..880b724 100644 --- a/src/main/java/io/github/ititus/math/hash/Hashing.java +++ b/src/main/java/io/github/ititus/commons/math/hash/Hashing.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.hash; +package io.github.ititus.commons.math.hash; public final class Hashing { diff --git a/src/main/java/io/github/ititus/math/hash/SHA1.java b/src/main/java/io/github/ititus/commons/math/hash/SHA1.java similarity index 96% rename from src/main/java/io/github/ititus/math/hash/SHA1.java rename to src/main/java/io/github/ititus/commons/math/hash/SHA1.java index 4f9f5f7..2d5237b 100644 --- a/src/main/java/io/github/ititus/math/hash/SHA1.java +++ b/src/main/java/io/github/ititus/commons/math/hash/SHA1.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.hash; +package io.github.ititus.commons.math.hash; import java.io.IOException; import java.io.UncheckedIOException; diff --git a/src/main/java/io/github/ititus/math/matrix/Mat2d.java b/src/main/java/io/github/ititus/commons/math/matrix/Mat2d.java similarity index 97% rename from src/main/java/io/github/ititus/math/matrix/Mat2d.java rename to src/main/java/io/github/ititus/commons/math/matrix/Mat2d.java index 54b895a..82876b5 100644 --- a/src/main/java/io/github/ititus/math/matrix/Mat2d.java +++ b/src/main/java/io/github/ititus/commons/math/matrix/Mat2d.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.matrix; +package io.github.ititus.commons.math.matrix; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.vector.Vec2d; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.vector.Vec2d; public final class Mat2d { diff --git a/src/main/java/io/github/ititus/math/matrix/Mat2f.java b/src/main/java/io/github/ititus/commons/math/matrix/Mat2f.java similarity index 97% rename from src/main/java/io/github/ititus/math/matrix/Mat2f.java rename to src/main/java/io/github/ititus/commons/math/matrix/Mat2f.java index 88eb891..2a6305e 100644 --- a/src/main/java/io/github/ititus/math/matrix/Mat2f.java +++ b/src/main/java/io/github/ititus/commons/math/matrix/Mat2f.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.matrix; +package io.github.ititus.commons.math.matrix; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.vector.Vec2f; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.vector.Vec2f; import java.nio.FloatBuffer; diff --git a/src/main/java/io/github/ititus/math/matrix/Mat3d.java b/src/main/java/io/github/ititus/commons/math/matrix/Mat3d.java similarity index 98% rename from src/main/java/io/github/ititus/math/matrix/Mat3d.java rename to src/main/java/io/github/ititus/commons/math/matrix/Mat3d.java index 4113b32..e6f50f4 100644 --- a/src/main/java/io/github/ititus/math/matrix/Mat3d.java +++ b/src/main/java/io/github/ititus/commons/math/matrix/Mat3d.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.matrix; +package io.github.ititus.commons.math.matrix; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.vector.Vec3d; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.vector.Vec3d; public final class Mat3d { diff --git a/src/main/java/io/github/ititus/math/matrix/Mat3f.java b/src/main/java/io/github/ititus/commons/math/matrix/Mat3f.java similarity index 98% rename from src/main/java/io/github/ititus/math/matrix/Mat3f.java rename to src/main/java/io/github/ititus/commons/math/matrix/Mat3f.java index 77e8388..5e1209d 100644 --- a/src/main/java/io/github/ititus/math/matrix/Mat3f.java +++ b/src/main/java/io/github/ititus/commons/math/matrix/Mat3f.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.matrix; +package io.github.ititus.commons.math.matrix; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.vector.Vec3f; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.vector.Vec3f; import java.nio.FloatBuffer; diff --git a/src/main/java/io/github/ititus/math/matrix/Mat4d.java b/src/main/java/io/github/ititus/commons/math/matrix/Mat4d.java similarity index 98% rename from src/main/java/io/github/ititus/math/matrix/Mat4d.java rename to src/main/java/io/github/ititus/commons/math/matrix/Mat4d.java index 02d32b0..f588a1d 100644 --- a/src/main/java/io/github/ititus/math/matrix/Mat4d.java +++ b/src/main/java/io/github/ititus/commons/math/matrix/Mat4d.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.matrix; +package io.github.ititus.commons.math.matrix; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.vector.Vec4d; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.vector.Vec4d; public final class Mat4d { diff --git a/src/main/java/io/github/ititus/math/matrix/Mat4f.java b/src/main/java/io/github/ititus/commons/math/matrix/Mat4f.java similarity index 98% rename from src/main/java/io/github/ititus/math/matrix/Mat4f.java rename to src/main/java/io/github/ititus/commons/math/matrix/Mat4f.java index 295587b..a67f2cf 100644 --- a/src/main/java/io/github/ititus/math/matrix/Mat4f.java +++ b/src/main/java/io/github/ititus/commons/math/matrix/Mat4f.java @@ -1,8 +1,8 @@ -package io.github.ititus.math.matrix; +package io.github.ititus.commons.math.matrix; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.vector.Vec3f; -import io.github.ititus.math.vector.Vec4f; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.vector.Vec3f; +import io.github.ititus.commons.math.vector.Vec4f; import java.nio.FloatBuffer; diff --git a/src/main/java/io/github/ititus/math/modulus/LinearModFunction.java b/src/main/java/io/github/ititus/commons/math/modulus/LinearModFunction.java similarity index 91% rename from src/main/java/io/github/ititus/math/modulus/LinearModFunction.java rename to src/main/java/io/github/ititus/commons/math/modulus/LinearModFunction.java index d1201c2..612faa2 100644 --- a/src/main/java/io/github/ititus/math/modulus/LinearModFunction.java +++ b/src/main/java/io/github/ititus/commons/math/modulus/LinearModFunction.java @@ -1,12 +1,12 @@ -package io.github.ititus.math.modulus; +package io.github.ititus.commons.math.modulus; -import io.github.ititus.math.number.BigIntegerMath; +import io.github.ititus.commons.math.number.BigIntegerMath; import java.math.BigInteger; import java.util.Objects; -import static io.github.ititus.math.number.BigIntegerConstants.ONE; -import static io.github.ititus.math.number.BigIntegerConstants.ZERO; +import static io.github.ititus.commons.math.number.BigIntegerConstants.ONE; +import static io.github.ititus.commons.math.number.BigIntegerConstants.ZERO; public final class LinearModFunction { diff --git a/src/main/java/io/github/ititus/math/number/BigComplex.java b/src/main/java/io/github/ititus/commons/math/number/BigComplex.java similarity index 97% rename from src/main/java/io/github/ititus/math/number/BigComplex.java rename to src/main/java/io/github/ititus/commons/math/number/BigComplex.java index 96ab1e3..d0722f0 100644 --- a/src/main/java/io/github/ititus/math/number/BigComplex.java +++ b/src/main/java/io/github/ititus/commons/math/number/BigComplex.java @@ -1,8 +1,8 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; -import io.github.ititus.data.ObjectUtil; -import io.github.ititus.data.pair.Pair; -import io.github.ititus.math.vector.Vec2i; +import io.github.ititus.commons.data.ObjectUtil; +import io.github.ititus.commons.data.pair.Pair; +import io.github.ititus.commons.math.vector.Vec2i; import java.lang.reflect.Array; import java.math.BigDecimal; @@ -15,8 +15,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static io.github.ititus.math.number.BigComplexConstants.*; - public final class BigComplex { private static final Pattern FULL_COMPLEX_PATTERN = Pattern.compile( @@ -201,9 +199,9 @@ public static BigComplex of(String s) { if (!m.matches()) { String withoutI = s.substring(0, length - 1); if (withoutI.isEmpty() || withoutI.equals("+")) { - return I; + return BigComplexConstants.I; } else if (withoutI.equals("-")) { - return MINUS_I; + return BigComplexConstants.MINUS_I; } return imag(BigRational.of(withoutI)); @@ -546,16 +544,16 @@ public static BigComplex of(BigDecimal real, BigRational imag) { public static BigComplex of(BigRational real, BigRational imag) { BigComplex z = new BigComplex(real, imag); - if (z.equals(ZERO)) { - return ZERO; - } else if (z.equals(ONE)) { - return ONE; - } else if (z.equals(I)) { - return I; - } else if (z.equals(MINUS_ONE)) { - return MINUS_ONE; - } else if (z.equals(MINUS_I)) { - return MINUS_I; + if (z.equals(BigComplexConstants.ZERO)) { + return BigComplexConstants.ZERO; + } else if (z.equals(BigComplexConstants.ONE)) { + return BigComplexConstants.ONE; + } else if (z.equals(BigComplexConstants.I)) { + return BigComplexConstants.I; + } else if (z.equals(BigComplexConstants.MINUS_ONE)) { + return BigComplexConstants.MINUS_ONE; + } else if (z.equals(BigComplexConstants.MINUS_I)) { + return BigComplexConstants.MINUS_I; } return z; @@ -768,7 +766,7 @@ public BigComplex inverse() { if (isZero()) { throw new ArithmeticException("zero is not invertible"); } else if (isOne()) { - return ONE; + return BigComplexConstants.ONE; } BigRational z = absSquared(); diff --git a/src/main/java/io/github/ititus/math/number/BigComplexConstants.java b/src/main/java/io/github/ititus/commons/math/number/BigComplexConstants.java similarity index 97% rename from src/main/java/io/github/ititus/math/number/BigComplexConstants.java rename to src/main/java/io/github/ititus/commons/math/number/BigComplexConstants.java index 3149d06..5e246df 100644 --- a/src/main/java/io/github/ititus/math/number/BigComplexConstants.java +++ b/src/main/java/io/github/ititus/commons/math/number/BigComplexConstants.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; -import static io.github.ititus.math.number.BigComplex.imag; -import static io.github.ititus.math.number.BigComplex.real; +import static io.github.ititus.commons.math.number.BigComplex.imag; +import static io.github.ititus.commons.math.number.BigComplex.real; public final class BigComplexConstants { diff --git a/src/main/java/io/github/ititus/math/number/BigComplexMath.java b/src/main/java/io/github/ititus/commons/math/number/BigComplexMath.java similarity index 66% rename from src/main/java/io/github/ititus/math/number/BigComplexMath.java rename to src/main/java/io/github/ititus/commons/math/number/BigComplexMath.java index 4e2c8e7..1346abf 100644 --- a/src/main/java/io/github/ititus/math/number/BigComplexMath.java +++ b/src/main/java/io/github/ititus/commons/math/number/BigComplexMath.java @@ -1,10 +1,9 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; import java.math.BigInteger; -import static io.github.ititus.math.number.BigComplex.imag; -import static io.github.ititus.math.number.BigComplex.of; -import static io.github.ititus.math.number.BigComplexConstants.*; +import static io.github.ititus.commons.math.number.BigComplex.imag; +import static io.github.ititus.commons.math.number.BigComplex.of; public final class BigComplexMath { @@ -33,7 +32,7 @@ public static BigComplex pow(BigComplex base, BigInteger exponent) { return pow(base, exponent.negate()).inverse(); } - BigComplex z = ONE; + BigComplex z = BigComplexConstants.ONE; while (exponent.signum() > 0) { if (BigIntegerMath.isOdd(exponent)) { z = z.multiply(base); @@ -63,9 +62,9 @@ public static BigComplex pow(BigComplex base, BigRational exponent) { public static BigComplex pow(BigComplex base, BigComplex exponent) { if (base.isOne() || exponent.isZero()) { - return ONE; + return BigComplexConstants.ONE; } else if (base.isZero()) { - return ZERO; + return BigComplexConstants.ZERO; } else if (exponent.isOne()) { return base; } else if (exponent.isReal()) { @@ -77,7 +76,7 @@ public static BigComplex pow(BigComplex base, BigComplex exponent) { public static BigComplex exp(BigComplex z) { if (z.isZero()) { - return ONE; + return BigComplexConstants.ONE; } BigRational r = BigRationalMath.exp(z.getReal()); @@ -89,7 +88,7 @@ public static BigComplex ln(BigComplex z) { if (z.isZero()) { throw new ArithmeticException("natural logarithm of zero"); } else if (z.isOne()) { - return ZERO; + return BigComplexConstants.ZERO; } return of(BigRationalMath.ln(z.abs()), angle(z)); @@ -100,18 +99,18 @@ public static BigComplex log(BigComplex base, BigComplex z) { } public static BigComplex sin(BigComplex z) { - BigComplex exp = exp(I.multiply(z)); + BigComplex exp = exp(BigComplexConstants.I.multiply(z)); return imag(BigRationalConstants.ONE_OVER_TWO.negate()).multiply(exp.subtract(exp.inverse())); } public static BigComplex cos(BigComplex z) { - BigComplex exp = exp(I.multiply(z)); - return ONE_OVER_TWO.multiply(exp.add(exp.inverse())); + BigComplex exp = exp(BigComplexConstants.I.multiply(z)); + return BigComplexConstants.ONE_OVER_TWO.multiply(exp.add(exp.inverse())); } public static BigComplex tan(BigComplex z) { BigComplex exp = exp(imag(BigRationalConstants.TWO).multiply(z)); - return MINUS_I.multiply(exp.subtract(ONE).divide(exp.add(ONE))); + return BigComplexConstants.MINUS_I.multiply(exp.subtract(BigComplexConstants.ONE).divide(exp.add(BigComplexConstants.ONE))); } public static BigComplex cot(BigComplex z) { @@ -127,43 +126,43 @@ public static BigComplex csc(BigComplex z) { } public static BigComplex asin(BigComplex z) { - return I.multiply(ln(sqrt(ONE.subtract(z.squared())).subtract(I.multiply(z)))); + return BigComplexConstants.I.multiply(ln(sqrt(BigComplexConstants.ONE.subtract(z.squared())).subtract(BigComplexConstants.I.multiply(z)))); } public static BigComplex acos(BigComplex z) { - return PI_OVER_TWO.subtract(asin(z)); + return BigComplexConstants.PI_OVER_TWO.subtract(asin(z)); } public static BigComplex atan(BigComplex z) { - return MINUS_I.divide(TWO).multiply(ln(I.subtract(z).divide(I.add(z)))); + return BigComplexConstants.MINUS_I.divide(BigComplexConstants.TWO).multiply(ln(BigComplexConstants.I.subtract(z).divide(BigComplexConstants.I.add(z)))); } public static BigComplex acot(BigComplex z) { - return PI_OVER_TWO.subtract(atan(z)); + return BigComplexConstants.PI_OVER_TWO.subtract(atan(z)); } public static BigComplex asec(BigComplex z) { BigComplex zInv = z.inverse(); - return MINUS_I.multiply(ln(I.multiply(sqrt(ONE.subtract(zInv.squared()))).add(zInv))); + return BigComplexConstants.MINUS_I.multiply(ln(BigComplexConstants.I.multiply(sqrt(BigComplexConstants.ONE.subtract(zInv.squared()))).add(zInv))); } public static BigComplex acsc(BigComplex z) { - return PI_OVER_TWO.subtract(asec(z)); + return BigComplexConstants.PI_OVER_TWO.subtract(asec(z)); } public static BigComplex sinh(BigComplex z) { BigComplex exp = exp(z); - return ONE_OVER_TWO.multiply(exp.subtract(exp.inverse())); + return BigComplexConstants.ONE_OVER_TWO.multiply(exp.subtract(exp.inverse())); } public static BigComplex cosh(BigComplex z) { BigComplex exp = exp(z); - return ONE_OVER_TWO.multiply(exp.add(exp.inverse())); + return BigComplexConstants.ONE_OVER_TWO.multiply(exp.add(exp.inverse())); } public static BigComplex tanh(BigComplex z) { - BigComplex exp = exp(TWO.multiply(z)); - return exp.subtract(ONE).divide(exp.add(ONE)); + BigComplex exp = exp(BigComplexConstants.TWO.multiply(z)); + return exp.subtract(BigComplexConstants.ONE).divide(exp.add(BigComplexConstants.ONE)); } public static BigComplex coth(BigComplex z) { @@ -179,28 +178,28 @@ public static BigComplex csch(BigComplex z) { } public static BigComplex asinh(BigComplex z) { - return ln(z.add(sqrt(z.squared().add(ONE)))); + return ln(z.add(sqrt(z.squared().add(BigComplexConstants.ONE)))); } public static BigComplex acosh(BigComplex z) { - return ln(z.add(sqrt(z.add(ONE)).multiply(sqrt(z.subtract(ONE))))); + return ln(z.add(sqrt(z.add(BigComplexConstants.ONE)).multiply(sqrt(z.subtract(BigComplexConstants.ONE))))); } public static BigComplex atanh(BigComplex z) { - return ONE_OVER_TWO.multiply(ln(ONE.add(z).divide(ONE.subtract(z)))); + return BigComplexConstants.ONE_OVER_TWO.multiply(ln(BigComplexConstants.ONE.add(z).divide(BigComplexConstants.ONE.subtract(z)))); } public static BigComplex acoth(BigComplex z) { - return ONE_OVER_TWO.multiply(ln(z.add(ONE).divide(z.subtract(ONE)))); + return BigComplexConstants.ONE_OVER_TWO.multiply(ln(z.add(BigComplexConstants.ONE).divide(z.subtract(BigComplexConstants.ONE)))); } public static BigComplex asech(BigComplex z) { BigComplex zInv = z.inverse(); - return ln(zInv.add(sqrt(zInv.add(ONE)).multiply(sqrt(zInv.subtract(ONE))))); + return ln(zInv.add(sqrt(zInv.add(BigComplexConstants.ONE)).multiply(sqrt(zInv.subtract(BigComplexConstants.ONE))))); } public static BigComplex acsch(BigComplex z) { BigComplex zInv = z.inverse(); - return ln(zInv.add(sqrt(zInv.squared().add(ONE)))); + return ln(zInv.add(sqrt(zInv.squared().add(BigComplexConstants.ONE)))); } } diff --git a/src/main/java/io/github/ititus/math/number/BigDecimalConstants.java b/src/main/java/io/github/ititus/commons/math/number/BigDecimalConstants.java similarity index 57% rename from src/main/java/io/github/ititus/math/number/BigDecimalConstants.java rename to src/main/java/io/github/ititus/commons/math/number/BigDecimalConstants.java index 6824ee0..7c93a87 100644 --- a/src/main/java/io/github/ititus/math/number/BigDecimalConstants.java +++ b/src/main/java/io/github/ititus/commons/math/number/BigDecimalConstants.java @@ -1,23 +1,20 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; import java.math.BigDecimal; -import static io.github.ititus.math.number.BigDecimalMath.inverse; -import static io.github.ititus.math.number.BigDecimalMath.of; - public final class BigDecimalConstants { public static final BigDecimal ZERO = BigDecimal.ZERO; public static final BigDecimal ONE = BigDecimal.ONE; - public static final BigDecimal TWO = of(2); - public static final BigDecimal THREE = of(3); - public static final BigDecimal FOUR = of(4); - public static final BigDecimal FIVE = of(5); - public static final BigDecimal SIX = of(6); - public static final BigDecimal SEVEN = of(7); - public static final BigDecimal EIGHT = of(8); - public static final BigDecimal NINE = of(9); + public static final BigDecimal TWO = BigDecimalMath.of(2); + public static final BigDecimal THREE = BigDecimalMath.of(3); + public static final BigDecimal FOUR = BigDecimalMath.of(4); + public static final BigDecimal FIVE = BigDecimalMath.of(5); + public static final BigDecimal SIX = BigDecimalMath.of(6); + public static final BigDecimal SEVEN = BigDecimalMath.of(7); + public static final BigDecimal EIGHT = BigDecimalMath.of(8); + public static final BigDecimal NINE = BigDecimalMath.of(9); public static final BigDecimal TEN = BigDecimal.TEN; public static final BigDecimal MINUS_ONE = ONE.negate(); @@ -31,15 +28,15 @@ public final class BigDecimalConstants { public static final BigDecimal MINUS_NINE = NINE.negate(); public static final BigDecimal MINUS_TEN = TEN.negate(); - public static final BigDecimal ONE_OVER_TWO = inverse(TWO); + public static final BigDecimal ONE_OVER_TWO = BigDecimalMath.inverse(TWO); public static final BigDecimal MINUS_ONE_OVER_TWO = ONE_OVER_TWO.negate(); - public static final BigDecimal ONE_OVER_FOUR = inverse(FOUR); + public static final BigDecimal ONE_OVER_FOUR = BigDecimalMath.inverse(FOUR); public static final BigDecimal MINUS_ONE_OVER_FOUR = ONE_OVER_FOUR.negate(); - public static final BigDecimal ONE_OVER_FIVE = inverse(FIVE); + public static final BigDecimal ONE_OVER_FIVE = BigDecimalMath.inverse(FIVE); public static final BigDecimal MINUS_ONE_OVER_FIVE = ONE_OVER_FIVE.negate(); - public static final BigDecimal ONE_OVER_EIGHT = inverse(EIGHT); + public static final BigDecimal ONE_OVER_EIGHT = BigDecimalMath.inverse(EIGHT); public static final BigDecimal MINUS_ONE_OVER_EIGHT = ONE_OVER_EIGHT.negate(); - public static final BigDecimal ONE_OVER_TEN = inverse(TEN); + public static final BigDecimal ONE_OVER_TEN = BigDecimalMath.inverse(TEN); public static final BigDecimal MINUS_ONE_OVER_TEN = ONE_OVER_TEN.negate(); private BigDecimalConstants() { diff --git a/src/main/java/io/github/ititus/math/number/BigDecimalMath.java b/src/main/java/io/github/ititus/commons/math/number/BigDecimalMath.java similarity index 95% rename from src/main/java/io/github/ititus/math/number/BigDecimalMath.java rename to src/main/java/io/github/ititus/commons/math/number/BigDecimalMath.java index cd7e30c..8b61d17 100644 --- a/src/main/java/io/github/ititus/math/number/BigDecimalMath.java +++ b/src/main/java/io/github/ititus/commons/math/number/BigDecimalMath.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; -import io.github.ititus.data.ArrayUtil; +import io.github.ititus.commons.data.ArrayUtil; import java.lang.reflect.Array; import java.math.BigDecimal; @@ -10,7 +10,7 @@ import java.util.Collection; import java.util.Objects; -import static io.github.ititus.math.number.BigDecimalConstants.ONE; +import static io.github.ititus.commons.math.number.BigDecimalConstants.ONE; public final class BigDecimalMath { diff --git a/src/main/java/io/github/ititus/math/number/BigIntegerConstants.java b/src/main/java/io/github/ititus/commons/math/number/BigIntegerConstants.java similarity index 68% rename from src/main/java/io/github/ititus/math/number/BigIntegerConstants.java rename to src/main/java/io/github/ititus/commons/math/number/BigIntegerConstants.java index ec2a4f4..d7a0c8a 100644 --- a/src/main/java/io/github/ititus/math/number/BigIntegerConstants.java +++ b/src/main/java/io/github/ititus/commons/math/number/BigIntegerConstants.java @@ -1,21 +1,19 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; import java.math.BigInteger; -import static io.github.ititus.math.number.BigIntegerMath.of; - public final class BigIntegerConstants { public static final BigInteger ZERO = BigInteger.ZERO; public static final BigInteger ONE = BigInteger.ONE; public static final BigInteger TWO = BigInteger.TWO; - public static final BigInteger THREE = of(3); - public static final BigInteger FOUR = of(4); - public static final BigInteger FIVE = of(5); - public static final BigInteger SIX = of(6); - public static final BigInteger SEVEN = of(7); - public static final BigInteger EIGHT = of(8); - public static final BigInteger NINE = of(9); + public static final BigInteger THREE = BigIntegerMath.of(3); + public static final BigInteger FOUR = BigIntegerMath.of(4); + public static final BigInteger FIVE = BigIntegerMath.of(5); + public static final BigInteger SIX = BigIntegerMath.of(6); + public static final BigInteger SEVEN = BigIntegerMath.of(7); + public static final BigInteger EIGHT = BigIntegerMath.of(8); + public static final BigInteger NINE = BigIntegerMath.of(9); public static final BigInteger TEN = BigInteger.TEN; public static final BigInteger MINUS_ONE = ONE.negate(); @@ -29,7 +27,7 @@ public final class BigIntegerConstants { public static final BigInteger MINUS_NINE = NINE.negate(); public static final BigInteger MINUS_TEN = TEN.negate(); - public static final BigInteger LONG_MAX_VALUE = of(Long.MAX_VALUE); + public static final BigInteger LONG_MAX_VALUE = BigIntegerMath.of(Long.MAX_VALUE); public static final BigInteger MINUS_LONG_MIN_VALUE = ONE.shiftLeft(Long.SIZE - 1); public static final BigInteger UNSIGNED_LONG_MAX_VALUE = ONE.shiftLeft(Long.SIZE).subtract(ONE); public static final BigInteger MINUS_UNSIGNED_LONG_MIN_VALUE = ONE.shiftLeft(Long.SIZE); diff --git a/src/main/java/io/github/ititus/math/number/BigIntegerMath.java b/src/main/java/io/github/ititus/commons/math/number/BigIntegerMath.java similarity index 97% rename from src/main/java/io/github/ititus/math/number/BigIntegerMath.java rename to src/main/java/io/github/ititus/commons/math/number/BigIntegerMath.java index b94e301..e419e71 100644 --- a/src/main/java/io/github/ititus/math/number/BigIntegerMath.java +++ b/src/main/java/io/github/ititus/commons/math/number/BigIntegerMath.java @@ -1,13 +1,13 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; -import io.github.ititus.data.ArrayUtil; +import io.github.ititus.commons.data.ArrayUtil; import java.lang.reflect.Array; import java.math.BigInteger; import java.util.*; -import static io.github.ititus.math.number.BigIntegerConstants.ONE; -import static io.github.ititus.math.number.BigIntegerConstants.ZERO; +import static io.github.ititus.commons.math.number.BigIntegerConstants.ONE; +import static io.github.ititus.commons.math.number.BigIntegerConstants.ZERO; public final class BigIntegerMath { diff --git a/src/main/java/io/github/ititus/math/number/BigRational.java b/src/main/java/io/github/ititus/commons/math/number/BigRational.java similarity index 99% rename from src/main/java/io/github/ititus/math/number/BigRational.java rename to src/main/java/io/github/ititus/commons/math/number/BigRational.java index 4a2f3e3..d6e9e18 100644 --- a/src/main/java/io/github/ititus/math/number/BigRational.java +++ b/src/main/java/io/github/ititus/commons/math/number/BigRational.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; -import io.github.ititus.data.ObjectUtil; -import io.github.ititus.si.quantity.value.QuantityValue; +import io.github.ititus.commons.data.ObjectUtil; +import io.github.ititus.commons.si.quantity.value.QuantityValue; import java.lang.reflect.Array; import java.math.BigDecimal; @@ -14,7 +14,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import static io.github.ititus.math.number.BigRationalConstants.*; +import static io.github.ititus.commons.math.number.BigRationalConstants.*; public final class BigRational extends Number implements Comparable { diff --git a/src/main/java/io/github/ititus/math/number/BigRationalConstants.java b/src/main/java/io/github/ititus/commons/math/number/BigRationalConstants.java similarity index 80% rename from src/main/java/io/github/ititus/math/number/BigRationalConstants.java rename to src/main/java/io/github/ititus/commons/math/number/BigRationalConstants.java index 71ea022..bd143f9 100644 --- a/src/main/java/io/github/ititus/math/number/BigRationalConstants.java +++ b/src/main/java/io/github/ititus/commons/math/number/BigRationalConstants.java @@ -1,6 +1,4 @@ -package io.github.ititus.math.number; - -import static io.github.ititus.math.number.BigRational.of; +package io.github.ititus.commons.math.number; public final class BigRationalConstants { @@ -8,44 +6,44 @@ public final class BigRationalConstants { public static final BigRational ONE = new BigRational(BigIntegerConstants.ONE, BigIntegerConstants.ONE); public static final BigRational MINUS_ONE = new BigRational(BigIntegerConstants.MINUS_ONE, BigIntegerConstants.ONE); - public static final BigRational TWO = of(2); + public static final BigRational TWO = BigRational.of(2); public static final BigRational MINUS_TWO = TWO.negate(); public static final BigRational ONE_OVER_TWO = TWO.inverse(); public static final BigRational MINUS_ONE_OVER_TWO = ONE_OVER_TWO.negate(); - public static final BigRational THREE = of(3); + public static final BigRational THREE = BigRational.of(3); public static final BigRational MINUS_THREE = THREE.negate(); public static final BigRational ONE_OVER_THREE = THREE.inverse(); public static final BigRational MINUS_ONE_OVER_THREE = ONE_OVER_THREE.negate(); - public static final BigRational FOUR = of(4); + public static final BigRational FOUR = BigRational.of(4); public static final BigRational MINUS_FOUR = FOUR.negate(); public static final BigRational ONE_OVER_FOUR = FOUR.inverse(); public static final BigRational MINUS_ONE_OVER_FOUR = ONE_OVER_FOUR.negate(); - public static final BigRational FIVE = of(5); + public static final BigRational FIVE = BigRational.of(5); public static final BigRational MINUS_FIVE = FIVE.negate(); public static final BigRational ONE_OVER_FIVE = FIVE.inverse(); public static final BigRational MINUS_ONE_OVER_FIVE = ONE_OVER_FIVE.negate(); - public static final BigRational SIX = of(6); + public static final BigRational SIX = BigRational.of(6); public static final BigRational MINUS_SIX = SIX.negate(); public static final BigRational ONE_OVER_SIX = SIX.inverse(); public static final BigRational MINUS_ONE_OVER_SIX = ONE_OVER_SIX.negate(); - public static final BigRational SEVEN = of(7); + public static final BigRational SEVEN = BigRational.of(7); public static final BigRational MINUS_SEVEN = SEVEN.negate(); public static final BigRational ONE_OVER_SEVEN = SEVEN.inverse(); public static final BigRational MINUS_ONE_OVER_SEVEN = ONE_OVER_SEVEN.negate(); - public static final BigRational EIGHT = of(8); + public static final BigRational EIGHT = BigRational.of(8); public static final BigRational MINUS_EIGHT = EIGHT.negate(); public static final BigRational ONE_OVER_EIGHT = EIGHT.inverse(); public static final BigRational MINUS_ONE_OVER_EIGHT = ONE_OVER_EIGHT.negate(); - public static final BigRational NINE = of(9); + public static final BigRational NINE = BigRational.of(9); public static final BigRational MINUS_NINE = NINE.negate(); public static final BigRational ONE_OVER_NINE = NINE.inverse(); public static final BigRational MINUS_ONE_OVER_NINE = ONE_OVER_NINE.negate(); - public static final BigRational TEN = of(10); + public static final BigRational TEN = BigRational.of(10); public static final BigRational MINUS_TEN = TEN.negate(); public static final BigRational ONE_OVER_TEN = TEN.inverse(); public static final BigRational MINUS_ONE_OVER_TEN = ONE_OVER_TEN.negate(); - public static final BigRational PI = of( + public static final BigRational PI = BigRational.of( "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446" ); public static final BigRational TWO_PI = PI.multiply(TWO); @@ -53,7 +51,7 @@ public final class BigRationalConstants { public static final BigRational PI_OVER_TWO = PI.divide(TWO); public static final BigRational MINUS_PI_OVER_TWO = PI_OVER_TWO.negate(); public static final BigRational MINUS_PI = PI.negate(); - public static final BigRational E = of( + public static final BigRational E = BigRational.of( "2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274274663919320030599218174136" ); diff --git a/src/main/java/io/github/ititus/math/number/BigRationalMath.java b/src/main/java/io/github/ititus/commons/math/number/BigRationalMath.java similarity index 97% rename from src/main/java/io/github/ititus/math/number/BigRationalMath.java rename to src/main/java/io/github/ititus/commons/math/number/BigRationalMath.java index 4232246..08deae1 100644 --- a/src/main/java/io/github/ititus/math/number/BigRationalMath.java +++ b/src/main/java/io/github/ititus/commons/math/number/BigRationalMath.java @@ -1,13 +1,12 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; -import io.github.ititus.math.calculation.NewtonApproximator; -import io.github.ititus.math.calculation.PowerSeriesCalculator; +import io.github.ititus.commons.math.calculation.NewtonApproximator; +import io.github.ititus.commons.math.calculation.PowerSeriesCalculator; import java.math.BigDecimal; import java.math.BigInteger; -import static io.github.ititus.math.number.BigRational.of; -import static io.github.ititus.math.number.BigRationalConstants.*; +import static io.github.ititus.commons.math.number.BigRationalConstants.*; public final class BigRationalMath { @@ -216,7 +215,7 @@ public static BigRational exp(BigRational x) { return E.pow(x.toBigInteger()); } else if (x.compareTo(ONE) > 0) { BigInteger n = TWO.multiply(x).toBigInteger(); - BigRational exp = PowerSeriesCalculator.exp(x.divide(of(n))); + BigRational exp = PowerSeriesCalculator.exp(x.divide(BigRational.of(n))); return exp.pow(n); } diff --git a/src/main/java/io/github/ititus/math/number/ExtendedGdcBigIntegerResult.java b/src/main/java/io/github/ititus/commons/math/number/ExtendedGdcBigIntegerResult.java similarity index 96% rename from src/main/java/io/github/ititus/math/number/ExtendedGdcBigIntegerResult.java rename to src/main/java/io/github/ititus/commons/math/number/ExtendedGdcBigIntegerResult.java index 5594677..7f45800 100644 --- a/src/main/java/io/github/ititus/math/number/ExtendedGdcBigIntegerResult.java +++ b/src/main/java/io/github/ititus/commons/math/number/ExtendedGdcBigIntegerResult.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; import java.math.BigInteger; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/math/number/ExtendedGdcIntResult.java b/src/main/java/io/github/ititus/commons/math/number/ExtendedGdcIntResult.java similarity index 91% rename from src/main/java/io/github/ititus/math/number/ExtendedGdcIntResult.java rename to src/main/java/io/github/ititus/commons/math/number/ExtendedGdcIntResult.java index 82a7ab0..e962f50 100644 --- a/src/main/java/io/github/ititus/math/number/ExtendedGdcIntResult.java +++ b/src/main/java/io/github/ititus/commons/math/number/ExtendedGdcIntResult.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; -import io.github.ititus.data.ArrayUtil; +import io.github.ititus.commons.data.ArrayUtil; public final class ExtendedGdcIntResult { diff --git a/src/main/java/io/github/ititus/math/number/ExtendedGdcLongResult.java b/src/main/java/io/github/ititus/commons/math/number/ExtendedGdcLongResult.java similarity index 91% rename from src/main/java/io/github/ititus/math/number/ExtendedGdcLongResult.java rename to src/main/java/io/github/ititus/commons/math/number/ExtendedGdcLongResult.java index c93aa14..fbc8e2f 100644 --- a/src/main/java/io/github/ititus/math/number/ExtendedGdcLongResult.java +++ b/src/main/java/io/github/ititus/commons/math/number/ExtendedGdcLongResult.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; -import io.github.ititus.data.ArrayUtil; +import io.github.ititus.commons.data.ArrayUtil; public final class ExtendedGdcLongResult { diff --git a/src/main/java/io/github/ititus/math/number/JavaMath.java b/src/main/java/io/github/ititus/commons/math/number/JavaMath.java similarity index 99% rename from src/main/java/io/github/ititus/math/number/JavaMath.java rename to src/main/java/io/github/ititus/commons/math/number/JavaMath.java index ea09065..339ca40 100644 --- a/src/main/java/io/github/ititus/math/number/JavaMath.java +++ b/src/main/java/io/github/ititus/commons/math/number/JavaMath.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.number; +package io.github.ititus.commons.math.number; -import io.github.ititus.data.ObjectUtil; +import io.github.ititus.commons.data.ObjectUtil; import java.lang.reflect.Array; import java.math.BigInteger; diff --git a/src/main/java/io/github/ititus/math/permutation/Permutations.java b/src/main/java/io/github/ititus/commons/math/permutation/Permutations.java similarity index 98% rename from src/main/java/io/github/ititus/math/permutation/Permutations.java rename to src/main/java/io/github/ititus/commons/math/permutation/Permutations.java index 60f961f..5f00a2f 100644 --- a/src/main/java/io/github/ititus/math/permutation/Permutations.java +++ b/src/main/java/io/github/ititus/commons/math/permutation/Permutations.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.permutation; +package io.github.ititus.commons.math.permutation; import java.util.*; import java.util.stream.Collectors; diff --git a/src/main/java/io/github/ititus/math/quaternion/Quatd.java b/src/main/java/io/github/ititus/commons/math/quaternion/Quatd.java similarity index 88% rename from src/main/java/io/github/ititus/math/quaternion/Quatd.java rename to src/main/java/io/github/ititus/commons/math/quaternion/Quatd.java index 8eb2ae0..6df98f5 100644 --- a/src/main/java/io/github/ititus/math/quaternion/Quatd.java +++ b/src/main/java/io/github/ititus/commons/math/quaternion/Quatd.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.quaternion; +package io.github.ititus.commons.math.quaternion; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.vector.Vec4d; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.vector.Vec4d; public final class Quatd { diff --git a/src/main/java/io/github/ititus/math/quaternion/Quatf.java b/src/main/java/io/github/ititus/commons/math/quaternion/Quatf.java similarity index 88% rename from src/main/java/io/github/ititus/math/quaternion/Quatf.java rename to src/main/java/io/github/ititus/commons/math/quaternion/Quatf.java index 6edd877..6376d10 100644 --- a/src/main/java/io/github/ititus/math/quaternion/Quatf.java +++ b/src/main/java/io/github/ititus/commons/math/quaternion/Quatf.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.quaternion; +package io.github.ititus.commons.math.quaternion; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.vector.Vec4f; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.vector.Vec4f; public final class Quatf { diff --git a/src/main/java/io/github/ititus/math/random/AdvRandom.java b/src/main/java/io/github/ititus/commons/math/random/AdvRandom.java similarity index 94% rename from src/main/java/io/github/ititus/math/random/AdvRandom.java rename to src/main/java/io/github/ititus/commons/math/random/AdvRandom.java index 83545da..2ae51bb 100644 --- a/src/main/java/io/github/ititus/math/random/AdvRandom.java +++ b/src/main/java/io/github/ititus/commons/math/random/AdvRandom.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.random; +package io.github.ititus.commons.math.random; import java.util.Collection; import java.util.List; diff --git a/src/main/java/io/github/ititus/math/random/RandomUtil.java b/src/main/java/io/github/ititus/commons/math/random/RandomUtil.java similarity index 97% rename from src/main/java/io/github/ititus/math/random/RandomUtil.java rename to src/main/java/io/github/ititus/commons/math/random/RandomUtil.java index 351fa5c..0af53ab 100644 --- a/src/main/java/io/github/ititus/math/random/RandomUtil.java +++ b/src/main/java/io/github/ititus/commons/math/random/RandomUtil.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.random; +package io.github.ititus.commons.math.random; import java.util.Collection; import java.util.List; diff --git a/src/main/java/io/github/ititus/math/statistics/ComplexStatistics.java b/src/main/java/io/github/ititus/commons/math/statistics/ComplexStatistics.java similarity index 91% rename from src/main/java/io/github/ititus/math/statistics/ComplexStatistics.java rename to src/main/java/io/github/ititus/commons/math/statistics/ComplexStatistics.java index 7b404e1..b27185d 100644 --- a/src/main/java/io/github/ititus/math/statistics/ComplexStatistics.java +++ b/src/main/java/io/github/ititus/commons/math/statistics/ComplexStatistics.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.statistics; +package io.github.ititus.commons.math.statistics; -import io.github.ititus.math.number.BigComplex; -import io.github.ititus.math.number.BigRational; +import io.github.ititus.commons.math.number.BigComplex; +import io.github.ititus.commons.math.number.BigRational; import java.util.ArrayList; import java.util.Collection; @@ -9,8 +9,8 @@ import java.util.function.Function; import java.util.stream.Collector; -import static io.github.ititus.math.number.BigComplexConstants.ONE; -import static io.github.ititus.math.number.BigComplexConstants.ZERO; +import static io.github.ititus.commons.math.number.BigComplexConstants.ONE; +import static io.github.ititus.commons.math.number.BigComplexConstants.ZERO; public final class ComplexStatistics { diff --git a/src/main/java/io/github/ititus/math/statistics/DurationStatistics.java b/src/main/java/io/github/ititus/commons/math/statistics/DurationStatistics.java similarity index 97% rename from src/main/java/io/github/ititus/math/statistics/DurationStatistics.java rename to src/main/java/io/github/ititus/commons/math/statistics/DurationStatistics.java index d81df92..a8c36b6 100644 --- a/src/main/java/io/github/ititus/math/statistics/DurationStatistics.java +++ b/src/main/java/io/github/ititus/commons/math/statistics/DurationStatistics.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.statistics; +package io.github.ititus.commons.math.statistics; import java.time.Duration; import java.util.ArrayList; diff --git a/src/main/java/io/github/ititus/math/statistics/IntegerStatistics.java b/src/main/java/io/github/ititus/commons/math/statistics/IntegerStatistics.java similarity index 93% rename from src/main/java/io/github/ititus/math/statistics/IntegerStatistics.java rename to src/main/java/io/github/ititus/commons/math/statistics/IntegerStatistics.java index bad8cd6..7af6a23 100644 --- a/src/main/java/io/github/ititus/math/statistics/IntegerStatistics.java +++ b/src/main/java/io/github/ititus/commons/math/statistics/IntegerStatistics.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.statistics; +package io.github.ititus.commons.math.statistics; -import io.github.ititus.math.number.BigRational; +import io.github.ititus.commons.math.number.BigRational; import java.math.BigInteger; import java.util.ArrayList; @@ -10,8 +10,8 @@ import java.util.function.Function; import java.util.stream.Collector; -import static io.github.ititus.math.number.BigRationalConstants.ONE; -import static io.github.ititus.math.number.BigRationalConstants.ZERO; +import static io.github.ititus.commons.math.number.BigRationalConstants.ONE; +import static io.github.ititus.commons.math.number.BigRationalConstants.ZERO; public final class IntegerStatistics { diff --git a/src/main/java/io/github/ititus/math/statistics/RationalStatistics.java b/src/main/java/io/github/ititus/commons/math/statistics/RationalStatistics.java similarity index 92% rename from src/main/java/io/github/ititus/math/statistics/RationalStatistics.java rename to src/main/java/io/github/ititus/commons/math/statistics/RationalStatistics.java index 1bd7a64..bbea09d 100644 --- a/src/main/java/io/github/ititus/math/statistics/RationalStatistics.java +++ b/src/main/java/io/github/ititus/commons/math/statistics/RationalStatistics.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.statistics; +package io.github.ititus.commons.math.statistics; -import io.github.ititus.math.number.BigRational; +import io.github.ititus.commons.math.number.BigRational; import java.util.ArrayList; import java.util.Collection; @@ -9,8 +9,8 @@ import java.util.function.Function; import java.util.stream.Collector; -import static io.github.ititus.math.number.BigRationalConstants.ONE; -import static io.github.ititus.math.number.BigRationalConstants.ZERO; +import static io.github.ititus.commons.math.number.BigRationalConstants.ONE; +import static io.github.ititus.commons.math.number.BigRationalConstants.ZERO; public final class RationalStatistics { diff --git a/src/main/java/io/github/ititus/math/time/DurationFormatter.java b/src/main/java/io/github/ititus/commons/math/time/DurationFormatter.java similarity index 96% rename from src/main/java/io/github/ititus/math/time/DurationFormatter.java rename to src/main/java/io/github/ititus/commons/math/time/DurationFormatter.java index 6a2f416..4be76fb 100644 --- a/src/main/java/io/github/ititus/math/time/DurationFormatter.java +++ b/src/main/java/io/github/ititus/commons/math/time/DurationFormatter.java @@ -1,8 +1,8 @@ -package io.github.ititus.math.time; +package io.github.ititus.commons.math.time; import java.time.Duration; -import static io.github.ititus.si.unit.Units.*; +import static io.github.ititus.commons.si.unit.Units.*; public final class DurationFormatter { diff --git a/src/main/java/io/github/ititus/math/time/StopWatch.java b/src/main/java/io/github/ititus/commons/math/time/StopWatch.java similarity index 95% rename from src/main/java/io/github/ititus/math/time/StopWatch.java rename to src/main/java/io/github/ititus/commons/math/time/StopWatch.java index fdca0e0..d2999e5 100644 --- a/src/main/java/io/github/ititus/math/time/StopWatch.java +++ b/src/main/java/io/github/ititus/commons/math/time/StopWatch.java @@ -1,4 +1,4 @@ -package io.github.ititus.math.time; +package io.github.ititus.commons.math.time; import java.time.Duration; diff --git a/src/main/java/io/github/ititus/math/time/StopWatchStatistics.java b/src/main/java/io/github/ititus/commons/math/time/StopWatchStatistics.java similarity index 92% rename from src/main/java/io/github/ititus/math/time/StopWatchStatistics.java rename to src/main/java/io/github/ititus/commons/math/time/StopWatchStatistics.java index 0da2647..bffe202 100644 --- a/src/main/java/io/github/ititus/math/time/StopWatchStatistics.java +++ b/src/main/java/io/github/ititus/commons/math/time/StopWatchStatistics.java @@ -1,6 +1,6 @@ -package io.github.ititus.math.time; +package io.github.ititus.commons.math.time; -import io.github.ititus.math.statistics.DurationStatistics; +import io.github.ititus.commons.math.statistics.DurationStatistics; import java.time.Duration; diff --git a/src/main/java/io/github/ititus/math/vector/Vec2d.java b/src/main/java/io/github/ititus/commons/math/vector/Vec2d.java similarity index 94% rename from src/main/java/io/github/ititus/math/vector/Vec2d.java rename to src/main/java/io/github/ititus/commons/math/vector/Vec2d.java index e9bc6a0..d94be99 100644 --- a/src/main/java/io/github/ititus/math/vector/Vec2d.java +++ b/src/main/java/io/github/ititus/commons/math/vector/Vec2d.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.vector; +package io.github.ititus.commons.math.vector; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.matrix.Mat2d; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.matrix.Mat2d; public final class Vec2d { diff --git a/src/main/java/io/github/ititus/math/vector/Vec2f.java b/src/main/java/io/github/ititus/commons/math/vector/Vec2f.java similarity index 93% rename from src/main/java/io/github/ititus/math/vector/Vec2f.java rename to src/main/java/io/github/ititus/commons/math/vector/Vec2f.java index f620cc3..fdff60b 100644 --- a/src/main/java/io/github/ititus/math/vector/Vec2f.java +++ b/src/main/java/io/github/ititus/commons/math/vector/Vec2f.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.vector; +package io.github.ititus.commons.math.vector; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.matrix.Mat2f; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.matrix.Mat2f; import java.nio.FloatBuffer; diff --git a/src/main/java/io/github/ititus/math/vector/Vec2i.java b/src/main/java/io/github/ititus/commons/math/vector/Vec2i.java similarity index 97% rename from src/main/java/io/github/ititus/math/vector/Vec2i.java rename to src/main/java/io/github/ititus/commons/math/vector/Vec2i.java index f3adf42..922c41f 100644 --- a/src/main/java/io/github/ititus/math/vector/Vec2i.java +++ b/src/main/java/io/github/ititus/commons/math/vector/Vec2i.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.vector; +package io.github.ititus.commons.math.vector; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.number.JavaMath; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.number.JavaMath; public final class Vec2i implements Comparable { diff --git a/src/main/java/io/github/ititus/math/vector/Vec3d.java b/src/main/java/io/github/ititus/commons/math/vector/Vec3d.java similarity index 95% rename from src/main/java/io/github/ititus/math/vector/Vec3d.java rename to src/main/java/io/github/ititus/commons/math/vector/Vec3d.java index fcb33df..bb2d1a6 100644 --- a/src/main/java/io/github/ititus/math/vector/Vec3d.java +++ b/src/main/java/io/github/ititus/commons/math/vector/Vec3d.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.vector; +package io.github.ititus.commons.math.vector; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.matrix.Mat3d; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.matrix.Mat3d; public final class Vec3d { diff --git a/src/main/java/io/github/ititus/math/vector/Vec3f.java b/src/main/java/io/github/ititus/commons/math/vector/Vec3f.java similarity index 95% rename from src/main/java/io/github/ititus/math/vector/Vec3f.java rename to src/main/java/io/github/ititus/commons/math/vector/Vec3f.java index e64b247..8639ef8 100644 --- a/src/main/java/io/github/ititus/math/vector/Vec3f.java +++ b/src/main/java/io/github/ititus/commons/math/vector/Vec3f.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.vector; +package io.github.ititus.commons.math.vector; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.matrix.Mat3f; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.matrix.Mat3f; import java.nio.FloatBuffer; diff --git a/src/main/java/io/github/ititus/math/vector/Vec3i.java b/src/main/java/io/github/ititus/commons/math/vector/Vec3i.java similarity index 93% rename from src/main/java/io/github/ititus/math/vector/Vec3i.java rename to src/main/java/io/github/ititus/commons/math/vector/Vec3i.java index d4b1f22..8277221 100644 --- a/src/main/java/io/github/ititus/math/vector/Vec3i.java +++ b/src/main/java/io/github/ititus/commons/math/vector/Vec3i.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.vector; +package io.github.ititus.commons.math.vector; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.number.JavaMath; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.number.JavaMath; public final class Vec3i implements Comparable { diff --git a/src/main/java/io/github/ititus/math/vector/Vec4d.java b/src/main/java/io/github/ititus/commons/math/vector/Vec4d.java similarity index 94% rename from src/main/java/io/github/ititus/math/vector/Vec4d.java rename to src/main/java/io/github/ititus/commons/math/vector/Vec4d.java index 7e3ddde..48fd32e 100644 --- a/src/main/java/io/github/ititus/math/vector/Vec4d.java +++ b/src/main/java/io/github/ititus/commons/math/vector/Vec4d.java @@ -1,8 +1,8 @@ -package io.github.ititus.math.vector; +package io.github.ititus.commons.math.vector; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.matrix.Mat4d; -import io.github.ititus.math.quaternion.Quatd; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.matrix.Mat4d; +import io.github.ititus.commons.math.quaternion.Quatd; public final class Vec4d { diff --git a/src/main/java/io/github/ititus/math/vector/Vec4f.java b/src/main/java/io/github/ititus/commons/math/vector/Vec4f.java similarity index 94% rename from src/main/java/io/github/ititus/math/vector/Vec4f.java rename to src/main/java/io/github/ititus/commons/math/vector/Vec4f.java index c307ce4..5ba3a11 100644 --- a/src/main/java/io/github/ititus/math/vector/Vec4f.java +++ b/src/main/java/io/github/ititus/commons/math/vector/Vec4f.java @@ -1,8 +1,8 @@ -package io.github.ititus.math.vector; +package io.github.ititus.commons.math.vector; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.matrix.Mat4f; -import io.github.ititus.math.quaternion.Quatf; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.matrix.Mat4f; +import io.github.ititus.commons.math.quaternion.Quatf; import java.nio.FloatBuffer; diff --git a/src/main/java/io/github/ititus/math/vector/Vec4i.java b/src/main/java/io/github/ititus/commons/math/vector/Vec4i.java similarity index 94% rename from src/main/java/io/github/ititus/math/vector/Vec4i.java rename to src/main/java/io/github/ititus/commons/math/vector/Vec4i.java index 1ae2bb1..275640f 100644 --- a/src/main/java/io/github/ititus/math/vector/Vec4i.java +++ b/src/main/java/io/github/ititus/commons/math/vector/Vec4i.java @@ -1,7 +1,7 @@ -package io.github.ititus.math.vector; +package io.github.ititus.commons.math.vector; -import io.github.ititus.data.ArrayUtil; -import io.github.ititus.math.number.JavaMath; +import io.github.ititus.commons.data.ArrayUtil; +import io.github.ititus.commons.math.number.JavaMath; public final class Vec4i implements Comparable { diff --git a/src/main/java/io/github/ititus/parser/Parser.java b/src/main/java/io/github/ititus/commons/parser/Parser.java similarity index 74% rename from src/main/java/io/github/ititus/parser/Parser.java rename to src/main/java/io/github/ititus/commons/parser/Parser.java index 351164f..2041352 100644 --- a/src/main/java/io/github/ititus/parser/Parser.java +++ b/src/main/java/io/github/ititus/commons/parser/Parser.java @@ -1,4 +1,4 @@ -package io.github.ititus.parser; +package io.github.ititus.commons.parser; import java.util.Optional; diff --git a/src/main/java/io/github/ititus/parser/ParserResult.java b/src/main/java/io/github/ititus/commons/parser/ParserResult.java similarity index 96% rename from src/main/java/io/github/ititus/parser/ParserResult.java rename to src/main/java/io/github/ititus/commons/parser/ParserResult.java index 3c27730..aa50d08 100644 --- a/src/main/java/io/github/ititus/parser/ParserResult.java +++ b/src/main/java/io/github/ititus/commons/parser/ParserResult.java @@ -1,4 +1,4 @@ -package io.github.ititus.parser; +package io.github.ititus.commons.parser; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/parser/Parsers.java b/src/main/java/io/github/ititus/commons/parser/Parsers.java similarity index 99% rename from src/main/java/io/github/ititus/parser/Parsers.java rename to src/main/java/io/github/ititus/commons/parser/Parsers.java index 134a735..a4b370b 100644 --- a/src/main/java/io/github/ititus/parser/Parsers.java +++ b/src/main/java/io/github/ititus/commons/parser/Parsers.java @@ -1,4 +1,4 @@ -package io.github.ititus.parser; +package io.github.ititus.commons.parser; import java.util.Optional; import java.util.function.BiFunction; diff --git a/src/main/java/io/github/ititus/precondition/BooleanPrecondition.java b/src/main/java/io/github/ititus/commons/precondition/BooleanPrecondition.java similarity index 87% rename from src/main/java/io/github/ititus/precondition/BooleanPrecondition.java rename to src/main/java/io/github/ititus/commons/precondition/BooleanPrecondition.java index b82de1f..a32045a 100644 --- a/src/main/java/io/github/ititus/precondition/BooleanPrecondition.java +++ b/src/main/java/io/github/ititus/commons/precondition/BooleanPrecondition.java @@ -1,7 +1,7 @@ -package io.github.ititus.precondition; +package io.github.ititus.commons.precondition; -import io.github.ititus.function.BooleanFunction; -import io.github.ititus.function.BooleanPredicate; +import io.github.ititus.commons.function.BooleanFunction; +import io.github.ititus.commons.function.BooleanPredicate; public final class BooleanPrecondition { diff --git a/src/main/java/io/github/ititus/precondition/ComparablePrecondition.java b/src/main/java/io/github/ititus/commons/precondition/ComparablePrecondition.java similarity index 98% rename from src/main/java/io/github/ititus/precondition/ComparablePrecondition.java rename to src/main/java/io/github/ititus/commons/precondition/ComparablePrecondition.java index 32e923c..dbd8411 100644 --- a/src/main/java/io/github/ititus/precondition/ComparablePrecondition.java +++ b/src/main/java/io/github/ititus/commons/precondition/ComparablePrecondition.java @@ -1,4 +1,4 @@ -package io.github.ititus.precondition; +package io.github.ititus.commons.precondition; import java.util.Objects; import java.util.function.Function; diff --git a/src/main/java/io/github/ititus/precondition/IntPrecondition.java b/src/main/java/io/github/ititus/commons/precondition/IntPrecondition.java similarity index 98% rename from src/main/java/io/github/ititus/precondition/IntPrecondition.java rename to src/main/java/io/github/ititus/commons/precondition/IntPrecondition.java index cc58bea..5a7ebd0 100644 --- a/src/main/java/io/github/ititus/precondition/IntPrecondition.java +++ b/src/main/java/io/github/ititus/commons/precondition/IntPrecondition.java @@ -1,4 +1,4 @@ -package io.github.ititus.precondition; +package io.github.ititus.commons.precondition; import java.util.function.IntFunction; import java.util.function.IntPredicate; diff --git a/src/main/java/io/github/ititus/precondition/LongPrecondition.java b/src/main/java/io/github/ititus/commons/precondition/LongPrecondition.java similarity index 98% rename from src/main/java/io/github/ititus/precondition/LongPrecondition.java rename to src/main/java/io/github/ititus/commons/precondition/LongPrecondition.java index 3189d27..9d88e78 100644 --- a/src/main/java/io/github/ititus/precondition/LongPrecondition.java +++ b/src/main/java/io/github/ititus/commons/precondition/LongPrecondition.java @@ -1,4 +1,4 @@ -package io.github.ititus.precondition; +package io.github.ititus.commons.precondition; import java.util.function.LongFunction; import java.util.function.LongPredicate; diff --git a/src/main/java/io/github/ititus/precondition/Precondition.java b/src/main/java/io/github/ititus/commons/precondition/Precondition.java similarity index 96% rename from src/main/java/io/github/ititus/precondition/Precondition.java rename to src/main/java/io/github/ititus/commons/precondition/Precondition.java index 13b8426..31ea66c 100644 --- a/src/main/java/io/github/ititus/precondition/Precondition.java +++ b/src/main/java/io/github/ititus/commons/precondition/Precondition.java @@ -1,4 +1,4 @@ -package io.github.ititus.precondition; +package io.github.ititus.commons.precondition; import java.util.Objects; import java.util.function.Function; diff --git a/src/main/java/io/github/ititus/precondition/PreconditionViolatedException.java b/src/main/java/io/github/ititus/commons/precondition/PreconditionViolatedException.java similarity index 89% rename from src/main/java/io/github/ititus/precondition/PreconditionViolatedException.java rename to src/main/java/io/github/ititus/commons/precondition/PreconditionViolatedException.java index a7676c5..6c191a9 100644 --- a/src/main/java/io/github/ititus/precondition/PreconditionViolatedException.java +++ b/src/main/java/io/github/ititus/commons/precondition/PreconditionViolatedException.java @@ -1,4 +1,4 @@ -package io.github.ititus.precondition; +package io.github.ititus.commons.precondition; public final class PreconditionViolatedException extends RuntimeException { diff --git a/src/main/java/io/github/ititus/precondition/Preconditions.java b/src/main/java/io/github/ititus/commons/precondition/Preconditions.java similarity index 97% rename from src/main/java/io/github/ititus/precondition/Preconditions.java rename to src/main/java/io/github/ititus/commons/precondition/Preconditions.java index 8a8201f..4cd5653 100644 --- a/src/main/java/io/github/ititus/precondition/Preconditions.java +++ b/src/main/java/io/github/ititus/commons/precondition/Preconditions.java @@ -1,4 +1,4 @@ -package io.github.ititus.precondition; +package io.github.ititus.commons.precondition; import java.util.Objects; import java.util.function.BooleanSupplier; diff --git a/src/main/java/io/github/ititus/precondition/StringPrecondition.java b/src/main/java/io/github/ititus/commons/precondition/StringPrecondition.java similarity index 96% rename from src/main/java/io/github/ititus/precondition/StringPrecondition.java rename to src/main/java/io/github/ititus/commons/precondition/StringPrecondition.java index 92a8187..db3cc46 100644 --- a/src/main/java/io/github/ititus/precondition/StringPrecondition.java +++ b/src/main/java/io/github/ititus/commons/precondition/StringPrecondition.java @@ -1,4 +1,4 @@ -package io.github.ititus.precondition; +package io.github.ititus.commons.precondition; import java.util.function.Function; import java.util.function.Predicate; diff --git a/src/main/java/io/github/ititus/si/NotCommensurableException.java b/src/main/java/io/github/ititus/commons/si/NotCommensurableException.java similarity index 94% rename from src/main/java/io/github/ititus/si/NotCommensurableException.java rename to src/main/java/io/github/ititus/commons/si/NotCommensurableException.java index 9392991..cebb5ff 100644 --- a/src/main/java/io/github/ititus/si/NotCommensurableException.java +++ b/src/main/java/io/github/ititus/commons/si/NotCommensurableException.java @@ -1,4 +1,4 @@ -package io.github.ititus.si; +package io.github.ititus.commons.si; public class NotCommensurableException extends RuntimeException { diff --git a/src/main/java/io/github/ititus/si/dimension/AbstractDimension.java b/src/main/java/io/github/ititus/commons/si/dimension/AbstractDimension.java similarity index 90% rename from src/main/java/io/github/ititus/si/dimension/AbstractDimension.java rename to src/main/java/io/github/ititus/commons/si/dimension/AbstractDimension.java index 7b6ec76..5fcfa68 100644 --- a/src/main/java/io/github/ititus/si/dimension/AbstractDimension.java +++ b/src/main/java/io/github/ititus/commons/si/dimension/AbstractDimension.java @@ -1,4 +1,4 @@ -package io.github.ititus.si.dimension; +package io.github.ititus.commons.si.dimension; public abstract class AbstractDimension implements Dimension { diff --git a/src/main/java/io/github/ititus/si/dimension/BaseDimension.java b/src/main/java/io/github/ititus/commons/si/dimension/BaseDimension.java similarity index 84% rename from src/main/java/io/github/ititus/si/dimension/BaseDimension.java rename to src/main/java/io/github/ititus/commons/si/dimension/BaseDimension.java index 7ebce58..befda4c 100644 --- a/src/main/java/io/github/ititus/si/dimension/BaseDimension.java +++ b/src/main/java/io/github/ititus/commons/si/dimension/BaseDimension.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.dimension; +package io.github.ititus.commons.si.dimension; -import io.github.ititus.data.Lazy; -import io.github.ititus.internal.Config; +import io.github.ititus.commons.data.Lazy; +import io.github.ititus.commons.internal.Config; import java.util.Map; diff --git a/src/main/java/io/github/ititus/si/dimension/CompoundDimension.java b/src/main/java/io/github/ititus/commons/si/dimension/CompoundDimension.java similarity index 98% rename from src/main/java/io/github/ititus/si/dimension/CompoundDimension.java rename to src/main/java/io/github/ititus/commons/si/dimension/CompoundDimension.java index 9412f81..aec3664 100644 --- a/src/main/java/io/github/ititus/si/dimension/CompoundDimension.java +++ b/src/main/java/io/github/ititus/commons/si/dimension/CompoundDimension.java @@ -1,4 +1,4 @@ -package io.github.ititus.si.dimension; +package io.github.ititus.commons.si.dimension; import java.util.Collections; import java.util.EnumMap; diff --git a/src/main/java/io/github/ititus/si/dimension/Dimension.java b/src/main/java/io/github/ititus/commons/si/dimension/Dimension.java similarity index 94% rename from src/main/java/io/github/ititus/si/dimension/Dimension.java rename to src/main/java/io/github/ititus/commons/si/dimension/Dimension.java index 42f953a..6c32a17 100644 --- a/src/main/java/io/github/ititus/si/dimension/Dimension.java +++ b/src/main/java/io/github/ititus/commons/si/dimension/Dimension.java @@ -1,4 +1,4 @@ -package io.github.ititus.si.dimension; +package io.github.ititus.commons.si.dimension; import java.util.Map; diff --git a/src/main/java/io/github/ititus/si/dimension/NoneDimension.java b/src/main/java/io/github/ititus/commons/si/dimension/NoneDimension.java similarity index 88% rename from src/main/java/io/github/ititus/si/dimension/NoneDimension.java rename to src/main/java/io/github/ititus/commons/si/dimension/NoneDimension.java index 7c5c98b..4e7ff56 100644 --- a/src/main/java/io/github/ititus/si/dimension/NoneDimension.java +++ b/src/main/java/io/github/ititus/commons/si/dimension/NoneDimension.java @@ -1,4 +1,4 @@ -package io.github.ititus.si.dimension; +package io.github.ititus.commons.si.dimension; import java.util.Map; diff --git a/src/main/java/io/github/ititus/si/prefix/BinaryPrefix.java b/src/main/java/io/github/ititus/commons/si/prefix/BinaryPrefix.java similarity index 93% rename from src/main/java/io/github/ititus/si/prefix/BinaryPrefix.java rename to src/main/java/io/github/ititus/commons/si/prefix/BinaryPrefix.java index 4ccce66..ca36bd8 100644 --- a/src/main/java/io/github/ititus/si/prefix/BinaryPrefix.java +++ b/src/main/java/io/github/ititus/commons/si/prefix/BinaryPrefix.java @@ -1,4 +1,4 @@ -package io.github.ititus.si.prefix; +package io.github.ititus.commons.si.prefix; public enum BinaryPrefix implements Prefix { diff --git a/src/main/java/io/github/ititus/si/prefix/MetricPrefix.java b/src/main/java/io/github/ititus/commons/si/prefix/MetricPrefix.java similarity index 90% rename from src/main/java/io/github/ititus/si/prefix/MetricPrefix.java rename to src/main/java/io/github/ititus/commons/si/prefix/MetricPrefix.java index 0540a7f..1aa83c2 100644 --- a/src/main/java/io/github/ititus/si/prefix/MetricPrefix.java +++ b/src/main/java/io/github/ititus/commons/si/prefix/MetricPrefix.java @@ -1,6 +1,6 @@ -package io.github.ititus.si.prefix; +package io.github.ititus.commons.si.prefix; -import io.github.ititus.internal.Config; +import io.github.ititus.commons.internal.Config; public enum MetricPrefix implements Prefix { diff --git a/src/main/java/io/github/ititus/si/prefix/Prefix.java b/src/main/java/io/github/ititus/commons/si/prefix/Prefix.java similarity index 69% rename from src/main/java/io/github/ititus/si/prefix/Prefix.java rename to src/main/java/io/github/ititus/commons/si/prefix/Prefix.java index 85316bf..c4d42ec 100644 --- a/src/main/java/io/github/ititus/si/prefix/Prefix.java +++ b/src/main/java/io/github/ititus/commons/si/prefix/Prefix.java @@ -1,4 +1,4 @@ -package io.github.ititus.si.prefix; +package io.github.ititus.commons.si.prefix; public interface Prefix { diff --git a/src/main/java/io/github/ititus/si/quantity/Constants.java b/src/main/java/io/github/ititus/commons/si/quantity/Constants.java similarity index 90% rename from src/main/java/io/github/ititus/si/quantity/Constants.java rename to src/main/java/io/github/ititus/commons/si/quantity/Constants.java index d33f19b..4a07b4e 100644 --- a/src/main/java/io/github/ititus/si/quantity/Constants.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/Constants.java @@ -1,15 +1,17 @@ -package io.github.ititus.si.quantity; +package io.github.ititus.commons.si.quantity; -import io.github.ititus.si.quantity.type.*; -import io.github.ititus.si.unit.Units; +import io.github.ititus.commons.si.quantity.type.*; +import io.github.ititus.commons.si.unit.Units; -import static io.github.ititus.math.number.BigRational.ofExp; -import static io.github.ititus.math.number.BigRationalConstants.PI; -import static io.github.ititus.math.number.BigRationalConstants.TWO_PI; -import static io.github.ititus.si.unit.Units.*; +import static io.github.ititus.commons.math.number.BigRational.ofExp; +import static io.github.ititus.commons.math.number.BigRationalConstants.PI; +import static io.github.ititus.commons.math.number.BigRationalConstants.TWO_PI; +import static io.github.ititus.commons.si.unit.Units.*; public final class Constants { + // @formatter:off + /* Defined (exact) constants used for the definition of the base units */ // Length @@ -96,6 +98,8 @@ public final class Constants { public static final Quantity FINE_STRUCTURE_CONSTANT = ELEMENTARY_CHARGE.pow(2).divide(VACUUM_ELECTRIC_PERMITTIVITY.multiply(REDUCED_PLANCK_CONSTANT).multiply(SPEED_OF_LIGHT).multiply(PI).multiply(4)).asStandard(Dimensionless.DIMENSIONLESS); + // @formatter:on + private Constants() { } } diff --git a/src/main/java/io/github/ititus/si/quantity/Quantity.java b/src/main/java/io/github/ititus/commons/si/quantity/Quantity.java similarity index 92% rename from src/main/java/io/github/ititus/si/quantity/Quantity.java rename to src/main/java/io/github/ititus/commons/si/quantity/Quantity.java index ab92803..719ff12 100644 --- a/src/main/java/io/github/ititus/si/quantity/Quantity.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/Quantity.java @@ -1,9 +1,9 @@ -package io.github.ititus.si.quantity; +package io.github.ititus.commons.si.quantity; -import io.github.ititus.math.number.BigRational; -import io.github.ititus.si.quantity.type.QuantityType; -import io.github.ititus.si.quantity.value.QuantityValue; -import io.github.ititus.si.unit.Unit; +import io.github.ititus.commons.math.number.BigRational; +import io.github.ititus.commons.si.quantity.type.QuantityType; +import io.github.ititus.commons.si.quantity.value.QuantityValue; +import io.github.ititus.commons.si.unit.Unit; import java.math.BigDecimal; import java.math.BigInteger; diff --git a/src/main/java/io/github/ititus/si/quantity/QuantityImpl.java b/src/main/java/io/github/ititus/commons/si/quantity/QuantityImpl.java similarity index 86% rename from src/main/java/io/github/ititus/si/quantity/QuantityImpl.java rename to src/main/java/io/github/ititus/commons/si/quantity/QuantityImpl.java index 34f062e..36d0b5a 100644 --- a/src/main/java/io/github/ititus/si/quantity/QuantityImpl.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/QuantityImpl.java @@ -1,8 +1,8 @@ -package io.github.ititus.si.quantity; +package io.github.ititus.commons.si.quantity; -import io.github.ititus.si.quantity.type.QuantityType; -import io.github.ititus.si.quantity.value.QuantityValue; -import io.github.ititus.si.unit.Unit; +import io.github.ititus.commons.si.quantity.type.QuantityType; +import io.github.ititus.commons.si.quantity.value.QuantityValue; +import io.github.ititus.commons.si.unit.Unit; import java.util.Objects; diff --git a/src/main/java/io/github/ititus/si/quantity/type/AbstractQuantityType.java b/src/main/java/io/github/ititus/commons/si/quantity/type/AbstractQuantityType.java similarity index 77% rename from src/main/java/io/github/ititus/si/quantity/type/AbstractQuantityType.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/AbstractQuantityType.java index 451b06c..4932597 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/AbstractQuantityType.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/AbstractQuantityType.java @@ -1,8 +1,8 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import io.github.ititus.data.Lazy; -import io.github.ititus.si.dimension.Dimension; -import io.github.ititus.si.unit.Unit; +import io.github.ititus.commons.data.Lazy; +import io.github.ititus.commons.si.dimension.Dimension; +import io.github.ititus.commons.si.unit.Unit; import java.util.function.Supplier; diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/Acceleration.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Acceleration.java new file mode 100644 index 0000000..177d6ce --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Acceleration.java @@ -0,0 +1,14 @@ +package io.github.ititus.commons.si.quantity.type; + +import static io.github.ititus.commons.si.dimension.BaseDimension.LENGTH; +import static io.github.ititus.commons.si.dimension.BaseDimension.TIME; +import static io.github.ititus.commons.si.unit.Units.METRES_PER_SECOND_SQUARED; + +public final class Acceleration extends AbstractQuantityType { + + public static final Acceleration ACCELERATION = new Acceleration(); + + private Acceleration() { + super(LENGTH.divide(TIME.pow(2)), () -> METRES_PER_SECOND_SQUARED); + } +} diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/Angle.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Angle.java new file mode 100644 index 0000000..58d924a --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Angle.java @@ -0,0 +1,14 @@ +package io.github.ititus.commons.si.quantity.type; + +import io.github.ititus.commons.si.dimension.Dimension; + +import static io.github.ititus.commons.si.unit.Units.RADIAN; + +public final class Angle extends AbstractQuantityType { + + public static final Angle ANGLE = new Angle(); + + private Angle() { + super(Dimension.NONE, () -> RADIAN); + } +} diff --git a/src/main/java/io/github/ititus/si/quantity/type/Area.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Area.java similarity index 50% rename from src/main/java/io/github/ititus/si/quantity/type/Area.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Area.java index cf8606d..da97793 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Area.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Area.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.LENGTH; -import static io.github.ititus.si.unit.Units.SQUARE_METRE; +import static io.github.ititus.commons.si.dimension.BaseDimension.LENGTH; +import static io.github.ititus.commons.si.unit.Units.SQUARE_METRE; public final class Area extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/CatalyticActivity.java b/src/main/java/io/github/ititus/commons/si/quantity/type/CatalyticActivity.java similarity index 51% rename from src/main/java/io/github/ititus/si/quantity/type/CatalyticActivity.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/CatalyticActivity.java index 2f1f056..53a6cce 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/CatalyticActivity.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/CatalyticActivity.java @@ -1,8 +1,8 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.SUBSTANCE_AMOUNT; -import static io.github.ititus.si.dimension.BaseDimension.TIME; -import static io.github.ititus.si.unit.Units.KATAL; +import static io.github.ititus.commons.si.dimension.BaseDimension.SUBSTANCE_AMOUNT; +import static io.github.ititus.commons.si.dimension.BaseDimension.TIME; +import static io.github.ititus.commons.si.unit.Units.KATAL; public final class CatalyticActivity extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/Density.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Density.java new file mode 100644 index 0000000..9a09d40 --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Density.java @@ -0,0 +1,14 @@ +package io.github.ititus.commons.si.quantity.type; + +import static io.github.ititus.commons.si.dimension.BaseDimension.LENGTH; +import static io.github.ititus.commons.si.dimension.BaseDimension.MASS; +import static io.github.ititus.commons.si.unit.Units.KILOGRAM_PER_CUBIC_METRE; + +public final class Density extends AbstractQuantityType { + + public static final Density DENSITY = new Density(); + + private Density() { + super(MASS.divide(LENGTH.pow(3)), () -> KILOGRAM_PER_CUBIC_METRE); + } +} diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/Dimensionless.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Dimensionless.java new file mode 100644 index 0000000..92bef91 --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Dimensionless.java @@ -0,0 +1,14 @@ +package io.github.ititus.commons.si.quantity.type; + +import io.github.ititus.commons.si.dimension.Dimension; + +import static io.github.ititus.commons.si.unit.Units.ONE; + +public final class Dimensionless extends AbstractQuantityType { + + public static final Dimensionless DIMENSIONLESS = new Dimensionless(); + + private Dimensionless() { + super(Dimension.NONE, () -> ONE); + } +} diff --git a/src/main/java/io/github/ititus/si/quantity/type/ElectricCapacitance.java b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCapacitance.java similarity index 65% rename from src/main/java/io/github/ititus/si/quantity/type/ElectricCapacitance.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCapacitance.java index 75b1abe..72e1154 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/ElectricCapacitance.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCapacitance.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.FARAD; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.FARAD; public final class ElectricCapacitance extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCharge.java b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCharge.java new file mode 100644 index 0000000..016c91a --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCharge.java @@ -0,0 +1,14 @@ +package io.github.ititus.commons.si.quantity.type; + +import static io.github.ititus.commons.si.dimension.BaseDimension.ELECTRIC_CURRENT; +import static io.github.ititus.commons.si.dimension.BaseDimension.TIME; +import static io.github.ititus.commons.si.unit.Units.COULOMB; + +public final class ElectricCharge extends AbstractQuantityType { + + public static final ElectricCharge ELECTRIC_CHARGE = new ElectricCharge(); + + private ElectricCharge() { + super(ELECTRIC_CURRENT.multiply(TIME), () -> COULOMB); + } +} diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricConductance.java b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricConductance.java new file mode 100644 index 0000000..d34a16b --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricConductance.java @@ -0,0 +1,14 @@ +package io.github.ititus.commons.si.quantity.type; + +import io.github.ititus.commons.si.dimension.BaseDimension; + +import static io.github.ititus.commons.si.unit.Units.SIEMENS; + +public final class ElectricConductance extends AbstractQuantityType { + + public static final ElectricConductance ELECTRIC_CONDUCTANCE = new ElectricConductance(); + + private ElectricConductance() { + super(BaseDimension.TIME.pow(3).multiply(BaseDimension.ELECTRIC_CURRENT.pow(2)).divide(BaseDimension.MASS.multiply(BaseDimension.LENGTH.pow(2))), () -> SIEMENS); + } +} diff --git a/src/main/java/io/github/ititus/si/quantity/type/ElectricCurrent.java b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCurrent.java similarity index 61% rename from src/main/java/io/github/ititus/si/quantity/type/ElectricCurrent.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCurrent.java index 0bf09d5..5b57387 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/ElectricCurrent.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCurrent.java @@ -1,8 +1,8 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import io.github.ititus.si.dimension.BaseDimension; +import io.github.ititus.commons.si.dimension.BaseDimension; -import static io.github.ititus.si.unit.Units.AMPERE; +import static io.github.ititus.commons.si.unit.Units.AMPERE; public final class ElectricCurrent extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCurrentDensity.java b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCurrentDensity.java new file mode 100644 index 0000000..a2f39d4 --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricCurrentDensity.java @@ -0,0 +1,14 @@ +package io.github.ititus.commons.si.quantity.type; + +import io.github.ititus.commons.si.dimension.BaseDimension; + +import static io.github.ititus.commons.si.unit.Units.AMPERE_PER_SQUARE_METRE; + +public final class ElectricCurrentDensity extends AbstractQuantityType { + + public static final ElectricCurrentDensity ELECTRIC_CURRENT_DENSITY = new ElectricCurrentDensity(); + + private ElectricCurrentDensity() { + super(BaseDimension.ELECTRIC_CURRENT.divide(BaseDimension.LENGTH.pow(2)), () -> AMPERE_PER_SQUARE_METRE); + } +} diff --git a/src/main/java/io/github/ititus/si/quantity/type/ElectricInductance.java b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricInductance.java similarity index 65% rename from src/main/java/io/github/ititus/si/quantity/type/ElectricInductance.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/ElectricInductance.java index ae40e7a..5b55feb 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/ElectricInductance.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricInductance.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.HENRY; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.HENRY; public final class ElectricInductance extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/ElectricPermittivity.java b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricPermittivity.java similarity index 66% rename from src/main/java/io/github/ititus/si/quantity/type/ElectricPermittivity.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/ElectricPermittivity.java index 6771fa0..ebb9290 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/ElectricPermittivity.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricPermittivity.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.FARAD_PER_METRE; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.FARAD_PER_METRE; public final class ElectricPermittivity extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/ElectricPotential.java b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricPotential.java similarity index 64% rename from src/main/java/io/github/ititus/si/quantity/type/ElectricPotential.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/ElectricPotential.java index 9ca512d..5f6075d 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/ElectricPotential.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricPotential.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.VOLT; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.VOLT; public final class ElectricPotential extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricResistance.java b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricResistance.java new file mode 100644 index 0000000..3945858 --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/ElectricResistance.java @@ -0,0 +1,14 @@ +package io.github.ititus.commons.si.quantity.type; + +import io.github.ititus.commons.si.dimension.BaseDimension; + +import static io.github.ititus.commons.si.unit.Units.OHM; + +public final class ElectricResistance extends AbstractQuantityType { + + public static final ElectricResistance ELECTRIC_RESISTANCE = new ElectricResistance(); + + private ElectricResistance() { + super(BaseDimension.MASS.multiply(BaseDimension.LENGTH.pow(2)).divide(BaseDimension.TIME.pow(3).multiply(BaseDimension.ELECTRIC_CURRENT.pow(2))), () -> OHM); + } +} diff --git a/src/main/java/io/github/ititus/si/quantity/type/Energy.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Energy.java similarity index 56% rename from src/main/java/io/github/ititus/si/quantity/type/Energy.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Energy.java index 7164c8b..05f4670 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Energy.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Energy.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.JOULE; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.JOULE; public final class Energy extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/EquivalentRadiationDose.java b/src/main/java/io/github/ititus/commons/si/quantity/type/EquivalentRadiationDose.java similarity index 55% rename from src/main/java/io/github/ititus/si/quantity/type/EquivalentRadiationDose.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/EquivalentRadiationDose.java index e5878c1..e49258e 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/EquivalentRadiationDose.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/EquivalentRadiationDose.java @@ -1,8 +1,8 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.LENGTH; -import static io.github.ititus.si.dimension.BaseDimension.TIME; -import static io.github.ititus.si.unit.Units.SIEVERT; +import static io.github.ititus.commons.si.dimension.BaseDimension.LENGTH; +import static io.github.ititus.commons.si.dimension.BaseDimension.TIME; +import static io.github.ititus.commons.si.unit.Units.SIEVERT; public final class EquivalentRadiationDose extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/Force.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Force.java similarity index 54% rename from src/main/java/io/github/ititus/si/quantity/type/Force.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Force.java index bcf19aa..58b82cb 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Force.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Force.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.NEWTON; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.NEWTON; public final class Force extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/Frequency.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Frequency.java similarity index 58% rename from src/main/java/io/github/ititus/si/quantity/type/Frequency.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Frequency.java index 7c7cfe0..4999a74 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Frequency.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Frequency.java @@ -1,9 +1,9 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import io.github.ititus.si.quantity.Quantity; +import io.github.ititus.commons.si.quantity.Quantity; -import static io.github.ititus.si.dimension.BaseDimension.TIME; -import static io.github.ititus.si.unit.Units.HERTZ; +import static io.github.ititus.commons.si.dimension.BaseDimension.TIME; +import static io.github.ititus.commons.si.unit.Units.HERTZ; public final class Frequency extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/Illuminance.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Illuminance.java new file mode 100644 index 0000000..fd0b64b --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Illuminance.java @@ -0,0 +1,14 @@ +package io.github.ititus.commons.si.quantity.type; + +import static io.github.ititus.commons.si.dimension.BaseDimension.LENGTH; +import static io.github.ititus.commons.si.dimension.BaseDimension.LUMINOUS_INTENSITY; +import static io.github.ititus.commons.si.unit.Units.LUX; + +public final class Illuminance extends AbstractQuantityType { + + public static final Illuminance ILLUMINANCE = new Illuminance(); + + private Illuminance() { + super(LUMINOUS_INTENSITY.divide(LENGTH.pow(2)), () -> LUX); + } +} diff --git a/src/main/java/io/github/ititus/si/quantity/type/Length.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Length.java similarity index 54% rename from src/main/java/io/github/ititus/si/quantity/type/Length.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Length.java index 7608844..ce9c6e4 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Length.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Length.java @@ -1,8 +1,8 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import io.github.ititus.si.dimension.BaseDimension; +import io.github.ititus.commons.si.dimension.BaseDimension; -import static io.github.ititus.si.unit.Units.METRE; +import static io.github.ititus.commons.si.unit.Units.METRE; public final class Length extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/LuminousEfficacy.java b/src/main/java/io/github/ititus/commons/si/quantity/type/LuminousEfficacy.java similarity index 63% rename from src/main/java/io/github/ititus/si/quantity/type/LuminousEfficacy.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/LuminousEfficacy.java index 625175e..b8ae0c6 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/LuminousEfficacy.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/LuminousEfficacy.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.LUMEN_PER_WATT; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.LUMEN_PER_WATT; public final class LuminousEfficacy extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/LuminousFlux.java b/src/main/java/io/github/ititus/commons/si/quantity/type/LuminousFlux.java similarity index 54% rename from src/main/java/io/github/ititus/si/quantity/type/LuminousFlux.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/LuminousFlux.java index c283f8e..77d5d7d 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/LuminousFlux.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/LuminousFlux.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.LUMINOUS_INTENSITY; -import static io.github.ititus.si.unit.Units.LUMEN; +import static io.github.ititus.commons.si.dimension.BaseDimension.LUMINOUS_INTENSITY; +import static io.github.ititus.commons.si.unit.Units.LUMEN; public final class LuminousFlux extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/LuminousIntensity.java b/src/main/java/io/github/ititus/commons/si/quantity/type/LuminousIntensity.java similarity index 62% rename from src/main/java/io/github/ititus/si/quantity/type/LuminousIntensity.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/LuminousIntensity.java index 9e8a042..1e200a3 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/LuminousIntensity.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/LuminousIntensity.java @@ -1,8 +1,8 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import io.github.ititus.si.dimension.BaseDimension; +import io.github.ititus.commons.si.dimension.BaseDimension; -import static io.github.ititus.si.unit.Units.CANDELA; +import static io.github.ititus.commons.si.unit.Units.CANDELA; public final class LuminousIntensity extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/MagneticFlux.java b/src/main/java/io/github/ititus/commons/si/quantity/type/MagneticFlux.java similarity index 62% rename from src/main/java/io/github/ititus/si/quantity/type/MagneticFlux.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/MagneticFlux.java index f7bfd40..1ba26ca 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/MagneticFlux.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/MagneticFlux.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.WEBER; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.WEBER; public final class MagneticFlux extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/MagneticFluxDensity.java b/src/main/java/io/github/ititus/commons/si/quantity/type/MagneticFluxDensity.java similarity index 63% rename from src/main/java/io/github/ititus/si/quantity/type/MagneticFluxDensity.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/MagneticFluxDensity.java index 55b2cbb..2fa00f9 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/MagneticFluxDensity.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/MagneticFluxDensity.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.TESLA; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.TESLA; public final class MagneticFluxDensity extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/MagneticPermeability.java b/src/main/java/io/github/ititus/commons/si/quantity/type/MagneticPermeability.java similarity index 65% rename from src/main/java/io/github/ititus/si/quantity/type/MagneticPermeability.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/MagneticPermeability.java index 8591823..c686b71 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/MagneticPermeability.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/MagneticPermeability.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.HENRY_PER_METRE; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.HENRY_PER_METRE; public final class MagneticPermeability extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/Mass.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Mass.java similarity index 52% rename from src/main/java/io/github/ititus/si/quantity/type/Mass.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Mass.java index b54177e..3554f10 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Mass.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Mass.java @@ -1,8 +1,8 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import io.github.ititus.si.dimension.BaseDimension; +import io.github.ititus.commons.si.dimension.BaseDimension; -import static io.github.ititus.si.unit.Units.KILOGRAM; +import static io.github.ititus.commons.si.unit.Units.KILOGRAM; public final class Mass extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/Momentum.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Momentum.java similarity index 55% rename from src/main/java/io/github/ititus/si/quantity/type/Momentum.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Momentum.java index bb8b523..1c17a69 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Momentum.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Momentum.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.KILOGRAM_METRES_PER_SECOND; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.KILOGRAM_METRES_PER_SECOND; public final class Momentum extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/Pace.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Pace.java new file mode 100644 index 0000000..7401708 --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Pace.java @@ -0,0 +1,20 @@ +package io.github.ititus.commons.si.quantity.type; + +import io.github.ititus.commons.si.quantity.Quantity; + +import static io.github.ititus.commons.si.dimension.BaseDimension.LENGTH; +import static io.github.ititus.commons.si.dimension.BaseDimension.TIME; +import static io.github.ititus.commons.si.unit.Units.SECONDS_PER_METRE; + +public final class Pace extends AbstractQuantityType { + + public static final Pace PACE = new Pace(); + + private Pace() { + super(TIME.divide(LENGTH), () -> SECONDS_PER_METRE); + } + + public static Quantity asPace(Quantity qty) { + return qty.inverse().as(PACE); + } +} diff --git a/src/main/java/io/github/ititus/si/quantity/type/Power.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Power.java similarity index 55% rename from src/main/java/io/github/ititus/si/quantity/type/Power.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Power.java index c7f0bcb..2e96791 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Power.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Power.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.WATT; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.WATT; public final class Power extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/Pressure.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Pressure.java similarity index 56% rename from src/main/java/io/github/ititus/si/quantity/type/Pressure.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Pressure.java index 72a4564..733c20f 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Pressure.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Pressure.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.*; -import static io.github.ititus.si.unit.Units.PASCAL; +import static io.github.ititus.commons.si.dimension.BaseDimension.*; +import static io.github.ititus.commons.si.unit.Units.PASCAL; public final class Pressure extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/QuantityType.java b/src/main/java/io/github/ititus/commons/si/quantity/type/QuantityType.java new file mode 100644 index 0000000..cad653d --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/QuantityType.java @@ -0,0 +1,12 @@ +package io.github.ititus.commons.si.quantity.type; + +import io.github.ititus.commons.si.dimension.Dimension; +import io.github.ititus.commons.si.unit.Unit; + +public interface QuantityType> { + + Dimension getDimension(); + + Unit getStandardUnit(); + +} diff --git a/src/main/java/io/github/ititus/si/quantity/type/RadiationDoseAbsorbed.java b/src/main/java/io/github/ititus/commons/si/quantity/type/RadiationDoseAbsorbed.java similarity index 54% rename from src/main/java/io/github/ititus/si/quantity/type/RadiationDoseAbsorbed.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/RadiationDoseAbsorbed.java index 78b73ef..3731f0c 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/RadiationDoseAbsorbed.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/RadiationDoseAbsorbed.java @@ -1,8 +1,8 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.LENGTH; -import static io.github.ititus.si.dimension.BaseDimension.TIME; -import static io.github.ititus.si.unit.Units.GRAY; +import static io.github.ititus.commons.si.dimension.BaseDimension.LENGTH; +import static io.github.ititus.commons.si.dimension.BaseDimension.TIME; +import static io.github.ititus.commons.si.unit.Units.GRAY; public final class RadiationDoseAbsorbed extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/Radioactivity.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Radioactivity.java similarity index 56% rename from src/main/java/io/github/ititus/si/quantity/type/Radioactivity.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Radioactivity.java index b079085..ffb18ef 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Radioactivity.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Radioactivity.java @@ -1,7 +1,7 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import static io.github.ititus.si.dimension.BaseDimension.TIME; -import static io.github.ititus.si.unit.Units.BECQUEREL; +import static io.github.ititus.commons.si.dimension.BaseDimension.TIME; +import static io.github.ititus.commons.si.unit.Units.BECQUEREL; public final class Radioactivity extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/SolidAngle.java b/src/main/java/io/github/ititus/commons/si/quantity/type/SolidAngle.java new file mode 100644 index 0000000..05eda34 --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/SolidAngle.java @@ -0,0 +1,14 @@ +package io.github.ititus.commons.si.quantity.type; + +import io.github.ititus.commons.si.dimension.Dimension; + +import static io.github.ititus.commons.si.unit.Units.STERADIAN; + +public final class SolidAngle extends AbstractQuantityType { + + public static final SolidAngle SOLID_ANGLE = new SolidAngle(); + + private SolidAngle() { + super(Dimension.NONE, () -> STERADIAN); + } +} diff --git a/src/main/java/io/github/ititus/commons/si/quantity/type/Speed.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Speed.java new file mode 100644 index 0000000..4a5cc46 --- /dev/null +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Speed.java @@ -0,0 +1,20 @@ +package io.github.ititus.commons.si.quantity.type; + +import io.github.ititus.commons.si.quantity.Quantity; + +import static io.github.ititus.commons.si.dimension.BaseDimension.LENGTH; +import static io.github.ititus.commons.si.dimension.BaseDimension.TIME; +import static io.github.ititus.commons.si.unit.Units.METRES_PER_SECOND; + +public final class Speed extends AbstractQuantityType { + + public static final Speed SPEED = new Speed(); + + private Speed() { + super(LENGTH.divide(TIME), () -> METRES_PER_SECOND); + } + + public static Quantity asSpeed(Quantity qty) { + return qty.inverse().as(SPEED); + } +} diff --git a/src/main/java/io/github/ititus/si/quantity/type/SubstanceAmount.java b/src/main/java/io/github/ititus/commons/si/quantity/type/SubstanceAmount.java similarity index 61% rename from src/main/java/io/github/ititus/si/quantity/type/SubstanceAmount.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/SubstanceAmount.java index b304aca..3cfbbb3 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/SubstanceAmount.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/SubstanceAmount.java @@ -1,8 +1,8 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import io.github.ititus.si.dimension.BaseDimension; +import io.github.ititus.commons.si.dimension.BaseDimension; -import static io.github.ititus.si.unit.Units.MOLE; +import static io.github.ititus.commons.si.unit.Units.MOLE; public final class SubstanceAmount extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/Temperature.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Temperature.java similarity index 58% rename from src/main/java/io/github/ititus/si/quantity/type/Temperature.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Temperature.java index 87f2f18..5dc8452 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Temperature.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Temperature.java @@ -1,8 +1,8 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import io.github.ititus.si.dimension.BaseDimension; +import io.github.ititus.commons.si.dimension.BaseDimension; -import static io.github.ititus.si.unit.Units.KELVIN; +import static io.github.ititus.commons.si.unit.Units.KELVIN; public final class Temperature extends AbstractQuantityType { diff --git a/src/main/java/io/github/ititus/si/quantity/type/Time.java b/src/main/java/io/github/ititus/commons/si/quantity/type/Time.java similarity index 73% rename from src/main/java/io/github/ititus/si/quantity/type/Time.java rename to src/main/java/io/github/ititus/commons/si/quantity/type/Time.java index bfbfbf0..c6cb320 100644 --- a/src/main/java/io/github/ititus/si/quantity/type/Time.java +++ b/src/main/java/io/github/ititus/commons/si/quantity/type/Time.java @@ -1,12 +1,12 @@ -package io.github.ititus.si.quantity.type; +package io.github.ititus.commons.si.quantity.type; -import io.github.ititus.si.dimension.BaseDimension; -import io.github.ititus.si.quantity.Quantity; +import io.github.ititus.commons.si.dimension.BaseDimension; +import io.github.ititus.commons.si.quantity.Quantity; import java.time.Duration; -import static io.github.ititus.si.unit.Units.NANOSECOND; -import static io.github.ititus.si.unit.Units.SECOND; +import static io.github.ititus.commons.si.unit.Units.NANOSECOND; +import static io.github.ititus.commons.si.unit.Units.SECOND; public final class Time extends AbstractQuantityType