|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--Message
A message class for sending data across the network: defines message types and constructors for messages. A message is just a type plus a list of fields for the message, you can interpret it however you want.
This might be done more cleanly with an abstract message class and subclasses for different types, but since there is no processing associated with message types, this implementation is simpler!
Field Summary | |
static int |
ACK_VOTE
We got your vote |
static int |
BAD_CANDIDATE
Bad candidate name given for vote request |
static int |
BAD_ELECTION
Bad election name given (closed or nonexistent) |
static int |
ERROR
Miscellaneous error, not currently used for anything |
java.util.LinkedList |
items
Fields of the message |
static int |
LIST_CANDIDATES
Here is the list of candidates |
static int |
QUERY_CANDIDATES
Give me the list of candidates for the named election |
static int |
SEND_VOTE
Here is my vote for election + candidate |
int |
type
Type of this message |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ERROR
public static final int BAD_ELECTION
public static final int BAD_CANDIDATE
public static final int QUERY_CANDIDATES
public static final int LIST_CANDIDATES
public static final int SEND_VOTE
public static final int ACK_VOTE
public int type
public java.util.LinkedList items
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |