Database Class Reference

Collaboration diagram for Database:

Collaboration graph
[legend]
List of all members.

Public Member Functions

String getQuestions (String bluetoothAddress, String friendlyName)
void saveVote (String vote, String bluetoothAddress)

Static Public Member Functions

static Database getInstance ()

Protected Member Functions

 Database ()

Private Attributes

GUI g

Static Private Attributes

static Database instance = null

Detailed Description

The Database class provides methods to get questions from, and save votes to, the web-based database.

Author:
Nick Day, "UniVote" Final Year Project, Lancaster University

Definition at line 15 of file Database.java.


Constructor & Destructor Documentation

Database.Database  )  [protected]
 

Instantiates this class by getting the instance of the GUI class.

See also:
GUI.getInstance

Definition at line 44 of file Database.java.

References g, and GUI.getInstance().

Referenced by getInstance().

Here is the call graph for this function:


Member Function Documentation

static Database Database.getInstance  )  [static]
 

Enforces the Singleton pattern to ensure only a single instance of this class exists. Returns the instance of this class if it is instantiated, otherwise it returns a new instantiation of this class.

Returns:
An instance of this class.

Definition at line 29 of file Database.java.

References Database(), and instance.

Referenced by BluetoothClient.BluetoothClient(), and BluetoothConnectionListener.BluetoothConnectionListener().

Here is the call graph for this function:

String Database.getQuestions String  bluetoothAddress,
String  friendlyName
 

Returns the list of questions for the current screen, which are available for voting by the specified bluetoothAddress.

Parameters:
bluetoothAddress The bluetooth address of the client device.
friendlyName The friendly name of the client device.
Returns:
The list of questions to be served to the client.

Definition at line 59 of file Database.java.

References g, GUI.getScreenName(), and GUI.traceProgressMessage().

Referenced by BluetoothConnectionListener.run().

Here is the call graph for this function:

void Database.saveVote String  vote,
String  bluetoothAddress
 

Saves a vote into the database.

Parameters:
vote The encoded string representing the vote.
bluetoothAddress The bluetooth address of the client device casting the vote.

Definition at line 99 of file Database.java.

Referenced by BluetoothClient.run().


Member Data Documentation

GUI Database.g [private]
 

Definition at line 19 of file Database.java.

Referenced by Database(), and getQuestions().

Database Database.instance = null [static, private]
 

Definition at line 18 of file Database.java.

Referenced by getInstance().


The documentation for this class was generated from the following file:
Generated on Mon Mar 13 22:04:05 2006 for UniVote Server Application by  doxygen 1.4.6