Package eu.bandm.tools.ops
Class RomanNumbers
java.lang.Object
eu.bandm.tools.ops.RomanNumbers
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint2roman
(int num, boolean uppercase) Public and Central Service Access Point.static void
roman2integer
(BiConsumer<String, Object[]> errorReceiver, String s, boolean lowercasesupported, boolean uppercasesupported, boolean subtractiveformat_directNeighbour, boolean subtractiveformat_fartherNeighbour) Public and Central Service Access Point to convert a string.
-
Field Details
-
romanLetterValues
-
thousands
-
hundreds
-
tens
-
units
-
-
Constructor Details
-
RomanNumbers
public RomanNumbers()
-
-
Method Details
-
roman2integer
@Opt public static final @Opt Integer roman2integer(BiConsumer<String, Object[]> errorReceiver, String s, boolean lowercasesupported, boolean uppercasesupported, boolean subtractiveformat_directNeighbour, boolean subtractiveformat_fartherNeighbour) Public and Central Service Access Point to convert a string. Supports string in all uppercase or all lowercase. Does not support MIXED subtractive and additive (like "CCCCIV").
The subtractive digit must be a power of ten, so VL, VC, VD, VM, LD and LM are not supported. (Use XLV, XCV, XDV, XMV, CDL and CML instead.)- Parameters:
errorReceiver
- for error text and argument arrays
- the string to convertlowercasesupported
- whether the input may be in lower case onlyuppercasesupported
- whether the input may be in upper case onlysubtractiveformat_directNeighbour
- Whether the immediately smaller digit left of a digit means subtractionsubtractiveformat_fartherNeighbour
- Whether ANY smaller digit left of a digit means subtraction- Returns:
- null in case of error (after sending error message)
-
int2roman
Public and Central Service Access Point. Delivers subtractive way of writing (IV, not IIII). MAXIMUM is currently MMMCMXCIX = 3999- Parameters:
num
- the number to convert.uppercase
- whether to return in uppercase, not lowercase.- Returns:
- the converted string, or null if limit 3999 is exceeded.
-
main
-