Package epam.roman

Class RomanToArabicConverter

java.lang.Object
epam.roman.RomanToArabicConverter
All Implemented Interfaces:
ToIntFunction<String>

public final class RomanToArabicConverter extends Object implements ToIntFunction<String>
A converter that converts Roman numerals to Arabic integers.
  • Constructor Details

    • RomanToArabicConverter

      public RomanToArabicConverter()
  • Method Details

    • applyAsInt

      public int applyAsInt(String roman)
      Converts a Roman numeral string to an Arabic integer.
      Specified by:
      applyAsInt in interface ToIntFunction<String>
      Parameters:
      roman - the Roman numeral string to be converted
      Returns:
      the Arabic integer representation of the Roman numeral