Class Util

java.lang.Object
  extended by Util

public class Util
extends java.lang.Object


Field Summary
static int ALPHABET_OFFSET
          Constant that can be used if needed.
static char INVALIDLETTER_CODE
          Constant that can be used if needed.
 
Constructor Summary
Util()
           
 
Method Summary
static char indexToLetter(int index)
          Performs conversion from integers 0..25 to letters 'A'..'Z'
static int letterToIndex(char letter)
          Performs conversion from letters 'A'..'Z' to integers 0..25
static boolean validLetter(char c)
          Checks whether the given character is a valid capital letter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALPHABET_OFFSET

public static final int ALPHABET_OFFSET
Constant that can be used if needed.

See Also:
Constant Field Values

INVALIDLETTER_CODE

public static final char INVALIDLETTER_CODE
Constant that can be used if needed.

See Also:
Constant Field Values
Constructor Detail

Util

public Util()
Method Detail

letterToIndex

public static int letterToIndex(char letter)
Performs conversion from letters 'A'..'Z' to integers 0..25

Parameters:
letter - is the input letter, a capital letter ('A'..'Z')
Returns:
the corresponding number (0..25)

indexToLetter

public static char indexToLetter(int index)
Performs conversion from integers 0..25 to letters 'A'..'Z'

Parameters:
index - is the input integer (0..25)
Returns:
the output letter ('A'..'Z')

validLetter

public static boolean validLetter(char c)
Checks whether the given character is a valid capital letter

Parameters:
c - is an input character
Returns:
true if and only if c is a capital letter ('A'..'Z')