Package eu.bandm.tools.util2
Class RomanNumbers
java.lang.Object
eu.bandm.tools.util2.RomanNumbers
FIXME sig/.../tscore/TransletLib auf diese klasse anpassen.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
error
(MessageReceiver<SimpleMessage<?>> msg, String s) protected static void
error
(MessageReceiver<SimpleMessage<?>> msg, String s, Object... os) f_roman2integer
(MessageReceiver<SimpleMessage<?>> msg, boolean lowercasesupported, boolean uppercasesupported, boolean subtractiveformat_directNeighbour, boolean subtractiveformat_fartherNeighbour) Deprecated.FIXME check if used in tscore??int2roman
(int num, boolean uppercase) Public and Central Service Access Point.static void
roman2integer
(MessageReceiver<SimpleMessage<?>> msg, 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
-
msg
-
-
Constructor Details
-
RomanNumbers
public RomanNumbers()
-
-
Method Details
-
error
-
error
-
f_roman2integer
public static final Function<String,Integer> f_roman2integer(MessageReceiver<SimpleMessage<?>> msg, boolean lowercasesupported, boolean uppercasesupported, boolean subtractiveformat_directNeighbour, boolean subtractiveformat_fartherNeighbour) Deprecated.FIXME check if used in tscore?? -
roman2integer
@Opt public static final @Opt Integer roman2integer(MessageReceiver<SimpleMessage<?>> msg, 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:
msg
- Message Receiver for error messagess
- 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
-