Class RomanNumbering.RomanDigit

  • Enclosing class:
    RomanNumbering

    private static class RomanNumbering.RomanDigit
    extends java.lang.Object
    Helper class for Roman Digits
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private char digit
      part of a roman number
      private boolean pre
      can the digit be used as a prefix
      private int value
      value of the roman digit
    • Constructor Summary

      Constructors 
      Constructor Description
      RomanDigit​(char digit, int value, boolean pre)
      Constructs a roman digit
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      char getDigit()
      Retrieves the roman digit.
      int getValue()
      Retrieves the value of the roman digit.
      boolean isPre()
      Retrieves whether the roman digit can be used as prefix.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • digit

        private final char digit
        part of a roman number
      • value

        private final int value
        value of the roman digit
      • pre

        private final boolean pre
        can the digit be used as a prefix
    • Constructor Detail

      • RomanDigit

        RomanDigit​(char digit,
                   int value,
                   boolean pre)
        Constructs a roman digit
        Parameters:
        digit - the roman digit
        value - the value
        pre - can it be used as a prefix
    • Method Detail

      • getDigit

        public char getDigit()
        Retrieves the roman digit.
        Returns:
        roman digit
      • getValue

        public int getValue()
        Retrieves the value of the roman digit.
        Returns:
        value
      • isPre

        public boolean isPre()
        Retrieves whether the roman digit can be used as prefix.
        Returns:
        true if it can, false otherwise