1 30 31 34 package com.nightlabs.math; 35 36 39 public class Base26CoderLowerCase 40 extends BaseNCoder 41 { 42 43 48 public Base26CoderLowerCase(boolean include09) 49 { 50 char[] symbols = new char[26]; 51 if (include09) { 52 char c = '0'; 53 for (int i = 0; i < 10; ++i) { 54 symbols[i] = c++; 55 } 56 c = 'a'; 57 for (int i = 10; i < symbols.length; ++i) { 58 symbols[i] = c++; 59 } 60 } 61 else { 62 char c = 'a'; 63 for (int i = 0; i < symbols.length; ++i) { 64 symbols[i] = c++; 65 } 66 } 67 68 init(symbols); 69 } 70 71 public static void main(String [] args) 72 { 73 Base26CoderLowerCase b = new Base26CoderLowerCase(false); 74 long l = 26; 75 String s = b.encode(l, 1); 76 System.out.println(s); 77 } 78 } 79 | Popular Tags |