net.ctdp.rfdynhud.util
Class ThreeLetterCodeManager

java.lang.Object
  extended by net.ctdp.rfdynhud.util.ThreeLetterCodeManager

public class ThreeLetterCodeManager
extends java.lang.Object

The ThreeLetterCodeManager loads name-to-code mappings from an ini file and provides the information to the user.

Author:
Marvin Froehlich (CTDP)

Constructor Summary
ThreeLetterCodeManager()
           
 
Method Summary
static java.lang.String getShortForm(java.lang.String driverName, java.lang.Integer driverID, ThreeLetterCodeGenerator tlcGenerator)
          Gets the short form assigned to the given driver-name.
static java.lang.String getThreeLetterCode(java.lang.String driverName, java.lang.Integer driverID, ThreeLetterCodeGenerator tlcGenerator)
          Gets the three-letter-code assigned to the given driver-name.
static int getUpdateId()
           
static void resetMaps()
           
static void updateThreeLetterCodes(java.io.File configFolder, ThreeLetterCodeGenerator tlcGenerator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreeLetterCodeManager

public ThreeLetterCodeManager()
Method Detail

getUpdateId

public static final int getUpdateId()

resetMaps

public static void resetMaps()

updateThreeLetterCodes

public static void updateThreeLetterCodes(java.io.File configFolder,
                                          ThreeLetterCodeGenerator tlcGenerator)

getThreeLetterCode

public static java.lang.String getThreeLetterCode(java.lang.String driverName,
                                                  java.lang.Integer driverID,
                                                  ThreeLetterCodeGenerator tlcGenerator)
Gets the three-letter-code assigned to the given driver-name. If there is no entry in the three_letter_codes.ini, it wil be generated and a warning will be dumped to the log.

Parameters:
driverName - the driver's full name
driverID - the driver's id
tlcGenerator -
Returns:
the three-letter-code.

getShortForm

public static java.lang.String getShortForm(java.lang.String driverName,
                                            java.lang.Integer driverID,
                                            ThreeLetterCodeGenerator tlcGenerator)
Gets the short form assigned to the given driver-name. If there is no entry in the three_letter_codes.ini, it wil be generated and a warning will be dumped to the log.

Parameters:
driverName - the driver's full name
driverID - the driver's id
tlcGenerator -
Returns:
the short form.