Class RomanAlphabetFactory


  • public class RomanAlphabetFactory
    extends java.lang.Object
    This class can produce String combinations representing a number. "a" to "z" represent 1 to 26, "AA" represents 27, "AB" represents 28, and so on; "ZZ" is followed by "AAA".
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getLowerCaseString​(int index)
      Translates a positive integer (not equal to zero) into a String using the letters 'a' to 'z'; 1 = a, 2 = b, ..., 26 = z, 27 = aa, 28 = ab,...
      static java.lang.String getString​(int index)
      Translates a positive integer (not equal to zero) into a String using the letters 'a' to 'z'; 1 = a, 2 = b, ..., 26 = z, 27 = aa, 28 = ab,...
      static java.lang.String getString​(int index, boolean lowercase)
      Translates a positive integer (not equal to zero) into a String using the letters 'a' to 'z' (a = 1, b = 2, ..., z = 26, aa = 27, ab = 28,...).
      static java.lang.String getUpperCaseString​(int index)
      Translates a positive integer (not equal to zero) into a String using the letters 'A' to 'Z'; 1 = A, 2 = B, ..., 26 = Z, 27 = AA, 28 = AB,...
      • Methods inherited from class java.lang.Object

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

      • RomanAlphabetFactory

        public RomanAlphabetFactory()
    • Method Detail

      • getString

        public static final java.lang.String getString​(int index)
        Translates a positive integer (not equal to zero) into a String using the letters 'a' to 'z'; 1 = a, 2 = b, ..., 26 = z, 27 = aa, 28 = ab,...
        Parameters:
        index - the index
        Returns:
        a translated string
      • getLowerCaseString

        public static final java.lang.String getLowerCaseString​(int index)
        Translates a positive integer (not equal to zero) into a String using the letters 'a' to 'z'; 1 = a, 2 = b, ..., 26 = z, 27 = aa, 28 = ab,...
        Parameters:
        index - the int to translate
        Returns:
        the string in lowercase
      • getUpperCaseString

        public static final java.lang.String getUpperCaseString​(int index)
        Translates a positive integer (not equal to zero) into a String using the letters 'A' to 'Z'; 1 = A, 2 = B, ..., 26 = Z, 27 = AA, 28 = AB,...
        Parameters:
        index - the int to translate
        Returns:
        the string in uppercase
      • getString

        public static final java.lang.String getString​(int index,
                                                       boolean lowercase)
        Translates a positive integer (not equal to zero) into a String using the letters 'a' to 'z' (a = 1, b = 2, ..., z = 26, aa = 27, ab = 28,...).
        Parameters:
        index - the int to translate
        lowercase - true if the string sshould be lowercase false otherwise
        Returns:
        the translated string