|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Client
The underlying code for the election client: this is where all the work gets
done. User actions through the user interface get resolved into calls to this
class, and it calls user interface
(ClientDisplay
)
methods to display results. The client communicates
with the server over a single connection.
Method Summary | |
void |
connect()
Make a connection to the server. |
void |
displayCandidates(java.lang.String election,
ClientDisplay display)
Obtain the list of candidates for the specified election and show them on the specified display. |
void |
vote(java.lang.String election,
java.lang.String candidate,
ClientDisplay display)
Cast the vote for the candidate in the specified election and display the results. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void displayCandidates(java.lang.String election, ClientDisplay display) throws MalformedMessageException, DisplayException, java.io.IOException
Message
class), the election could be closed or invalid, or the reply could
be of the wrong message type, or there might be an I/O error.
MalformedMessageException
DisplayException
java.io.IOException
public void vote(java.lang.String election, java.lang.String candidate, ClientDisplay display) throws MalformedMessageException, DisplayException, java.io.IOException
MalformedMessageException
DisplayException
java.io.IOException
public void connect() throws java.net.UnknownHostException, ServerUnreachableException, java.io.IOException
java.net.UnknownHostException
ServerUnreachableException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |