Class AlphabetNumbering


  • public class AlphabetNumbering
    extends java.lang.Object
    This is a general class for alphabet numbering. You can specify an alphabet and convert an integer into the corresponding alphabet number representation. E.g.: if the alphabet is English letters 'a' to 'z', then 1 is represented as "a", ..., 26 is represented as "z", 27 is represented as "aa" and so on.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String toAlphabetNumber​(int number, char[] alphabet)
      Translates a positive integer (not equal to zero) into an alphabet number using the letters from the specified alphabet.
      • Methods inherited from class java.lang.Object

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

      • AlphabetNumbering

        public AlphabetNumbering()
    • Method Detail

      • toAlphabetNumber

        public static java.lang.String toAlphabetNumber​(int number,
                                                        char[] alphabet)
        Translates a positive integer (not equal to zero) into an alphabet number using the letters from the specified alphabet.
        Parameters:
        number - the number
        alphabet - the array containing all possible letters from the alphabet
        Returns:
        a translated number representation