aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/utils')
-rw-r--r--src/main/java/de/hysky/skyblocker/utils/RomanNumerals.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/de/hysky/skyblocker/utils/RomanNumerals.java b/src/main/java/de/hysky/skyblocker/utils/RomanNumerals.java
index 5f273f8e..007cb0b1 100644
--- a/src/main/java/de/hysky/skyblocker/utils/RomanNumerals.java
+++ b/src/main/java/de/hysky/skyblocker/utils/RomanNumerals.java
@@ -16,6 +16,13 @@ public class RomanNumerals {
};
}
+ /**
+ * Checks if a string is a valid roman numeral.
+ * It's the caller's responsibility to clean up the string before calling this method (such as trimming it).
+ * @param romanNumeral The roman numeral to check.
+ * @return True if the string is a valid roman numeral, false otherwise.
+ * @implNote This will only check if the string contains valid roman numeral characters. It won't check if the numeral is well-formed.
+ */
public static boolean isValidRomanNumeral(String romanNumeral) {
if (romanNumeral == null || romanNumeral.isEmpty()) return false;
for (int i = 0; i < romanNumeral.length(); i++) {
@@ -28,7 +35,7 @@ public class RomanNumerals {
* Converts a roman numeral to a decimal number.
*
* @param romanNumeral The roman numeral to convert.
- * @return The decimal number, or 0 if the roman numeral string is malformed, empty or null.
+ * @return The decimal number, or 0 if the roman numeral string has non-roman characters in it, or if the string is empty or null.
*/
public static int romanToDecimal(String romanNumeral) {
if (romanNumeral == null || romanNumeral.isEmpty()) return 0;