eu.keep.emulatorarchive
Class H2EmulatorPackageDAO

Object
  extended by H2EmulatorPackageDAO
All Implemented Interfaces:
EmulatorPackageDAO

public class H2EmulatorPackageDAO
extends Object
implements EmulatorPackageDAO

H2 database implementation of the EmuPackageDAO interface.

Author:
David Michel
See Also:
website: http://www.h2database.com

Constructor Summary
H2EmulatorPackageDAO(Connection conn)
          Constructor
 
Method Summary
 List<Integer> getEmuID(String hardwareName)
          Returns the emulator ID based on a given target hardware type
 int getEmulatorCount()
          Count the number of emulator available
 String getEmulatorDescription(Integer emuID)
          Returns the emulator description
 String getEmulatorExecDir(Integer emuID)
          Returns the name of the directory in which the emulator executable is located
 String getEmulatorExecName(Integer emuID)
          Returns the emulator executable name
 String getEmulatorExecType(Integer emuID)
          Returns the executable type associated with an emulator
 List<Integer> getEmulatorIDs()
          Returns the IDs of all available emulator packages
 String getEmulatorInstructions(Integer emuID)
          Returns the user instructions for an emulator
 String getEmulatorLanguageId(Integer emuID)
          Returns the emulator language name
 String getEmulatorName(Integer emuID)
          Returns the emulator name
 InputStream getEmulatorPackage(Integer emuID)
          Returns the executable package associated with an emulator
 String getEmulatorPackageFileName(Integer emuID)
          Returns the package file name associated with an emulator
 String getEmulatorPackageType(Integer emuID)
          Returns the package type associated with an emulator
 String getEmulatorVersion(Integer emuID)
          Returns the emulator version
 List<String> getHardware(Integer emuID)
          Returns the list of formats supported by an emulator
 List<String> getHardwareIDs()
          Returns a list of hardware supported by the available emulators
 List<String> getHardwareNames()
          Returns a list of hardware names supported by the available emulators
 List<String> getImageFormats(Integer emuID)
          Returns the list of formats supported by an emulator
 EmuLanguageList getLanguages()
          Returns the languages from the Languages table
 String getPackageVersion(Integer emuID)
          Returns the package file name associated with an emulator
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

H2EmulatorPackageDAO

public H2EmulatorPackageDAO(Connection conn)
Constructor

Parameters:
conn - a connection to an H2 database
Method Detail

getPackageVersion

public String getPackageVersion(Integer emuID)
Returns the package file name associated with an emulator

Specified by:
getPackageVersion in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
String the package version

getEmuID

public List<Integer> getEmuID(String hardwareName)
Returns the emulator ID based on a given target hardware type

Specified by:
getEmuID in interface EmulatorPackageDAO
Parameters:
hardwareName - The type to search on
Returns:
List List of matching emulator IDs

getEmulatorCount

public int getEmulatorCount()
Count the number of emulator available

Specified by:
getEmulatorCount in interface EmulatorPackageDAO
Returns:
List of Integers

getEmulatorIDs

public List<Integer> getEmulatorIDs()
Returns the IDs of all available emulator packages

Specified by:
getEmulatorIDs in interface EmulatorPackageDAO
Returns:
List of Integers

getHardwareIDs

public List<String> getHardwareIDs()
Returns a list of hardware supported by the available emulators

Specified by:
getHardwareIDs in interface EmulatorPackageDAO
Returns:
Set of hardware

getHardwareNames

public List<String> getHardwareNames()
Returns a list of hardware names supported by the available emulators

Specified by:
getHardwareNames in interface EmulatorPackageDAO
Returns:
List of hardware names

getEmulatorPackage

public InputStream getEmulatorPackage(Integer emuID)
Returns the executable package associated with an emulator

Specified by:
getEmulatorPackage in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
InputStream A handle to the binary

getEmulatorPackageFileName

public String getEmulatorPackageFileName(Integer emuID)
Returns the package file name associated with an emulator

Specified by:
getEmulatorPackageFileName in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
String the emulator package file name

getEmulatorName

public String getEmulatorName(Integer emuID)
Returns the emulator name

Specified by:
getEmulatorName in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
String the executable type

getEmulatorVersion

public String getEmulatorVersion(Integer emuID)
Returns the emulator version

Specified by:
getEmulatorVersion in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
String the emulator version

getEmulatorLanguageId

public String getEmulatorLanguageId(Integer emuID)
Returns the emulator language name

Specified by:
getEmulatorLanguageId in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
EmulatorLanguage the language object associated with this emulator

getEmulatorDescription

public String getEmulatorDescription(Integer emuID)
Returns the emulator description

Specified by:
getEmulatorDescription in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
String the emulator description

getEmulatorExecType

public String getEmulatorExecType(Integer emuID)
Returns the executable type associated with an emulator

Specified by:
getEmulatorExecType in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
String the executable type

getEmulatorInstructions

public String getEmulatorInstructions(Integer emuID)
Returns the user instructions for an emulator

Specified by:
getEmulatorInstructions in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
list of hardware name

getEmulatorPackageType

public String getEmulatorPackageType(Integer emuID)
Returns the package type associated with an emulator

Specified by:
getEmulatorPackageType in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
String the executable type

getEmulatorExecName

public String getEmulatorExecName(Integer emuID)
Returns the emulator executable name

Specified by:
getEmulatorExecName in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
String representing the executable name

getEmulatorExecDir

public String getEmulatorExecDir(Integer emuID)
Returns the name of the directory in which the emulator executable is located

Specified by:
getEmulatorExecDir in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
String representing the directory

getImageFormats

public List<String> getImageFormats(Integer emuID)
Returns the list of formats supported by an emulator

Specified by:
getImageFormats in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
list of image format name

getHardware

public List<String> getHardware(Integer emuID)
Returns the list of formats supported by an emulator

Specified by:
getHardware in interface EmulatorPackageDAO
Parameters:
emuID - emulator ID
Returns:
list of hardware name

getLanguages

public EmuLanguageList getLanguages()
Description copied from interface: EmulatorPackageDAO
Returns the languages from the Languages table

Specified by:
getLanguages in interface EmulatorPackageDAO
Returns:
List of values from the table