A B C D E G I L M N O P Q R S T U V W

A

ACK_VOTE - Static variable in class Message
We got your vote
actionPerformed(ActionEvent) - Method in class ClientDisplay.ChooseElectionButtonListener
 
actionPerformed(ActionEvent) - Method in class ClientDisplay.VoteButtonListener
 
actionPerformed(ActionEvent) - Method in class ServerDisplay.OpenElectionButtonListener
 
actionPerformed(ActionEvent) - Method in class ServerDisplay.CloseElectionButtonListener
 
actionPerformed(ActionEvent) - Method in class ServerDisplay.ViewElectionButtonListener
 
actionPerformed(ActionEvent) - Method in class ServerDisplay.ExitButtonListener
 
actionPerformed(ActionEvent) - Method in class ServerDisplay.CloseWindowListener
 
add(String, int) - Method in class ServerDisplay.VoteTable
 
addCandidate(String) - Method in class Election
Add a candidate to this election, only called when the election is created, on server startup

B

BAD_CANDIDATE - Static variable in class Message
Bad candidate name given for vote request
BAD_ELECTION - Static variable in class Message
Bad election name given (closed or nonexistent)

C

chooseCandidate(String) - Method in class ClientDisplay
 
chooseElection(String) - Method in class ClientDisplay
 
Client - class Client.
The underlying code for the election client: this is where all the work gets done.
ClientDisplay - class ClientDisplay.
A GUI for the election client.
ClientDisplay.ChooseElectionButtonListener - class ClientDisplay.ChooseElectionButtonListener.
 
ClientDisplay.VoteButtonListener - class ClientDisplay.VoteButtonListener.
 
close(ServerDisplay) - Method in class Election
Close this election and display results, error if already closed (only called by election server manager)
closeElection(String) - Method in class ServerDisplay
 
closeElection(String, ServerDisplay) - Method in class Server
Close the specified election, called by election server manager only.
connect() - Method in class Client
Make a connection to the server.
Constants - class Constants.
Constants shared between election client and election server.
Constants() - Constructor for class Constants
 

D

DEFAULT_PORT - Static variable in class Constants
Default port the server listens on for client connections
displayCandidates(String, ClientDisplay) - Method in class Client
Obtain the list of candidates for the specified election and show them on the specified display.
displayElections(ServerDisplay) - Method in class Server
Show the list of elections on the indicated display, called by election server manager only.
DisplayException - exception DisplayException.
The operation requested failed, here is an error message to show to the user.

E

Election - class Election.
Implementation for a single election, which is has a string name and a list of candidates and count of votes for each candidate.
ElectionClient - class ElectionClient.
Start the election client, connecting to a server on a particular host on a particular port.
ElectionClient() - Constructor for class ElectionClient
 
ElectionNotOpenException - exception ElectionNotOpenException.
The election specified is not open, so the operation requested could not be performed.
ElectionServer - class ElectionServer.
Startup code for the election server.
ElectionServer() - Constructor for class ElectionServer
 
ERROR - Static variable in class Message
Miscellaneous error, not currently used for anything
error(String) - Method in class ClientDisplay
 
error(String) - Method in class ServerDisplay
 

G

getCandidates() - Method in class Election
Get a list of the candidates for the election, error if closed (only called by worker threads)
getCandidates(String) - Method in class Server
Called by worker thread to get candidates for election "poll".
getColumnClass(int) - Method in class ServerDisplay.VoteTable
 
getColumnCount() - Method in class ServerDisplay.VoteTable
 
getElections() - Method in class Server
Called by worker thread to get a list of elections (not used).
getRowCount() - Method in class ServerDisplay.VoteTable
 
getValueAt(int, int) - Method in class ServerDisplay.VoteTable
 

I

isCellEditable(int, int) - Method in class ServerDisplay.VoteTable
 
isOpen() - Method in class Election
Is this election open?
items - Variable in class Message
Fields of the message

L

LIST_CANDIDATES - Static variable in class Message
Here is the list of candidates

M

main(String[]) - Static method in class ElectionClient
 
main(String[]) - Static method in class ElectionServer
Create the Server to the real work, then create the appropriate ServerDisplay (GUI) and fork the Network Network processing thread and hook them up to the server.
Message - class Message.
A message class for sending data across the network: defines message types and constructors for messages.

N

name - Variable in class Election
Name of this election
Network - class Network.
Component for handling messages from clients.
notify(String) - Method in class ClientDisplay
 
notify(String) - Method in class ServerDisplay
 
numCandidates() - Method in class Election
Get the number of candidates in this election

O

open(ServerDisplay) - Method in class Election
Reset vote counts and open this election, error if already open (only called by election server manager)
openElection(String) - Method in class ServerDisplay
 
openElection(String, ServerDisplay) - Method in class Server
Open the specified election, called by election server manager only.

P

ParsingException - exception ParsingException.
An error occured while parsing the elections file.
port - Variable in class Server
Port to open server socket on.
putCandidate(String) - Method in class ClientDisplay
 
putCandidate(String, int) - Method in class ServerDisplay
 
putElection(String) - Method in class ServerDisplay
 
putReceipt(String, String) - Method in class ClientDisplay
 
putTitle(String) - Method in class ServerDisplay
 
putWinner(String, int) - Method in class ServerDisplay
 

Q

QUERY_CANDIDATES - Static variable in class Message
Give me the list of candidates for the named election

R

run() - Method in class ClientDisplay
 
run() - Method in class Network
 
run() - Method in class ServerDisplay
 
run() - Method in class Worker
 

S

SEND_VOTE - Static variable in class Message
Here is my vote for election + candidate
Server - class Server.
The actual code for operating on elections: maintains the collection of elections and has methods which Worker threads and the election s">election server manager can call.
ServerDisplay - class ServerDisplay.
A GUI for the election server manager.
ServerDisplay.CloseElectionButtonListener - class ServerDisplay.CloseElectionButtonListener.
 
ServerDisplay.CloseWindowListener - class ServerDisplay.CloseWindowListener.
 
ServerDisplay.ExitButtonListener - class ServerDisplay.ExitButtonListener.
 
ServerDisplay.ExitButtonListener() - Constructor for class ServerDisplay.ExitButtonListener
 
ServerDisplay.OpenElectionButtonListener - class ServerDisplay.OpenElectionButtonListener.
 
ServerDisplay.ViewElectionButtonListener - class ServerDisplay.ViewElectionButtonListener.
 
ServerDisplay.VoteTable - class ServerDisplay.VoteTable.
 
ServerUnreachableException - exception ServerUnreachableException.
The server does not exist or cannot be contacted.
start() - Method in class ClientDisplay
 
start() - Method in class ServerDisplay
 

T

type - Variable in class Message
Type of this message

U

UndefinedCandidateException - exception UndefinedCandidateException.
The election the operation applies to exists, but there is no candidate of the name specified in the election
UndefinedElectionException - exception UndefinedElectionException.
The election specified does not exist, or it exists, but it is closed

V

view(ServerDisplay) - Method in class Election
Display results for this election, error if open (only called by election server manager
viewElection(String) - Method in class ServerDisplay
 
viewElection(String, ServerDisplay) - Method in class Server
 
vote(JFrame, String, String) - Method in class ClientDisplay
 
vote(String) - Method in class Election
Count a vote for this candidate, error if candidate not found or election not open (only called by worker threads)
vote(String, String) - Method in class Server
Called by worker thread to vote for a candidate for election "poll".
vote(String, String, ClientDisplay) - Method in class Client
Cast the vote for the candidate in the specified election and display the results.

W

Worker - class Worker.
Server processing for an individual client request.

A B C D E G I L M N O P Q R S T U V W