Class RomanNumbers

java.lang.Object
eu.bandm.tools.util2.RomanNumbers

public class RomanNumbers extends Object
FIXME sig/.../tscore/TransletLib auf diese klasse anpassen.
  • Field Details

    • romanLetterValues

      protected static final Map<Character,Integer> romanLetterValues
    • thousands

      public static final String[] thousands
    • hundreds

      public static final String[] hundreds
    • tens

      public static final String[] tens
    • units

      public static final String[] units
    • msg

      static final MessageReceiver msg
  • Constructor Details

    • RomanNumbers

      public RomanNumbers()
  • Method Details

    • error

      protected static void error(MessageReceiver<SimpleMessage<?>> msg, String s)
    • error

      protected static void error(MessageReceiver<SimpleMessage<?>> msg, String s, Object... os)
    • 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 messages
      s - the string to convert
      lowercasesupported - whether the input may be in lower case only
      uppercasesupported - whether the input may be in upper case only
      subtractiveformat_directNeighbour - Whether the immediately smaller digit left of a digit means subtraction
      subtractiveformat_fartherNeighbour - Whether ANY smaller digit left of a digit means subtraction
      Returns:
      null in case of error (after sending error message)
    • int2roman

      @Opt public static @Opt String int2roman(int num, boolean uppercase)
      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

      public static void main(String[] args)