diff options
author | miozune <miozune@gmail.com> | 2023-05-17 00:01:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 17:01:01 +0200 |
commit | 04514282c08ebefdb3e68a46db34092f72be2316 (patch) | |
tree | 0c9bc99f480f7e7f45a99a55a5b6619ebb5b014b /src/main/java/Ic2ExpReactorPlanner/BigintStorage.java | |
parent | cd58ff7cd4dc4b5ffe917a24a4b4c6da577f462d (diff) | |
download | GT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.tar.gz GT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.tar.bz2 GT5-Unofficial-04514282c08ebefdb3e68a46db34092f72be2316.zip |
Remove a lot of unused classes (#629)
Diffstat (limited to 'src/main/java/Ic2ExpReactorPlanner/BigintStorage.java')
-rw-r--r-- | src/main/java/Ic2ExpReactorPlanner/BigintStorage.java | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/main/java/Ic2ExpReactorPlanner/BigintStorage.java b/src/main/java/Ic2ExpReactorPlanner/BigintStorage.java deleted file mode 100644 index d9d4d62c3c..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/BigintStorage.java +++ /dev/null @@ -1,64 +0,0 @@ -package Ic2ExpReactorPlanner; - -import java.math.BigInteger; -import java.util.Base64; - -/** - * Stores numbers of varying size inside a BigInteger, expecting each to have a defined limit (which need not be an - * exact power of 2). Numbers are to be extracted in reverse order they were stored, and special values can be used to - * make certain values optional for inclusion (the calling class is responsible for handling this logic, though). - * - * @author Brian McCloud - */ -public class BigintStorage { - - private BigInteger storedValue = BigInteger.ZERO; - - /** - * Stores the specified value. Requires that 0 <= value <= max. - * - * @param value the value to store. - * @param max the expected maximum for the value. - */ - public void store(int value, int max) { - if (value < 0 || value > max) { - throw new IllegalArgumentException(); - } - storedValue = storedValue.multiply(BigInteger.valueOf(max + 1)).add(BigInteger.valueOf(value)); - } - - /** - * Extracts a value based on the specified maximum. - * - * @param max the expected maximum for the value. - * @return the extracted value. - */ - public int extract(int max) { - BigInteger[] values = storedValue.divideAndRemainder(BigInteger.valueOf(max + 1)); - storedValue = values[0]; - return values[1].intValue(); - } - - /** - * Takes input of a Base64 string, and converts it to a BigintStorage. - * - * @param code the Base64-encoded string (presumed to be from @outputBase64) - * @return the converted storage object. - */ - public static BigintStorage inputBase64(String code) { - BigintStorage result = new BigintStorage(); - byte[] temp = Base64.getDecoder().decode(code); - result.storedValue = new BigInteger(temp); - return result; - } - - /** - * Outputs the current value of this BigintStorage as a Base64-encoded string. - * - * @return the Base64-encoded string. - */ - public String outputBase64() { - byte[] temp = storedValue.toByteArray(); - return Base64.getEncoder().encodeToString(temp); - } -} |