I created a hashing method to make a=1, b=2, c=3...etc. To me it doesn't seem too efficient. Does this look efficient or is there a recursive method or smaller method to do the same thing?
/**
* Changes String to int
* @param key: String
* @return (result % arraySize): int
*/
public int hashFunc (String key)
{
int result = 0;
String inputString = key.toString().toLowerCase();
// changes String to lowercase
char [] characters = inputString.toCharArray(); // makes String an Array
for (int i = 0; i < characters.length; i++) // loop
{
char currentChar = characters[i]; // gets current character
if (currentChar == 'a')
{ // if character is a
result += 1;
// get character numbers
}// end if
if (currentChar == 'b')
{ // if character is b
result += 2;
// get character numbers
}// end if
if (currentChar == 'c')
{ // if character is c
result += 3;
// get character numbers
}// end if
if (currentChar == 'd')
{ // if character isd
result += 4;
// get character numbers
}// end if
if (currentChar == 'e')
{ // if character is e
result += 5;
// get character numbers
}// end if
if (currentChar == 'f')
{ // if character is f
result += 6;
// get character numbers
}// end if
if (currentChar == 'g')
{ // if character is g
result += 7;
// get character numbers
}// end if
if (currentChar == 'h')
{ // if character is h
result += 8;
// get character numbers
}// end if
if (currentChar == 'i')
{ // if character is i
result += 9;
// get character numbers
}// end if
if (currentChar == 'j')
{ // if character is j
result += 10;
// get character numbers
}// end if
if (currentChar == 'k')
{ // if character is k
result += 11;
// get character numbers
}// end if
if (currentChar == 'l')
{ // if character is l
result += 12;
// get character numbers
}// end if
if (currentChar == 'm')
{ // if character is m
result += 13;
// get character numbers
}// end if
if (currentChar == 'n')
{ // if character is n
result += 14;
// get character numbers
}// end if
if (currentChar == 'o')
{ // if character is 0
result += 15;
// get character numbers
}// end if
if (currentChar == 'p')
{ // if character is p
result += 16;
// get character numbers
}// end if
if (currentChar == 'q')
{ // if character is q
result += 17;
// get character numbers
}// end if
if (currentChar == 'r')
{ // if character is r
result += 18;
// get character numbers
}// end if
if (currentChar == 's')
{ // if character is s
result += 19;
// get character numbers
}// end if
if (currentChar == 't')
{ // if character is t
result += 20;
// get character numbers
}// end if
if (currentChar == 'u')
{ // if character is u
result += 21;
// get character numbers
}// end if
if (currentChar == 'v')
{ // if character is v
result += 22;
// get character numbers
}// end if
if (currentChar == 'w')
{ // if character is w
result += 23;
// get character numbers
}// end if
if (currentChar == 'x')
{ // if character is x
result += 24;
// get character numbers
}// end if
if (currentChar == 'y')
{ // if character is y
result += 25;
// get character numbers
}// end if
if (currentChar == 'z')
{ // if character is z
result += 26;
// get character numbers
}// end if
}// end for
return (result % arraySize); // returns Hashed values
} // end hashFunc1()