|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjimm.evote.Vote
A vote stored by a booth.
Instead of writing accessor methods, I've made the ivars public.
Vote
s are essentially simple data structures.
Field Summary | |
byte[] |
boothAddress
Booth IP address. |
int |
candidateID
Candidate ID number. |
int |
candidateParty
Identifies the candidate's party ( PARTY_SILLY , etc.) |
java.lang.String |
key
Primary key. |
static int |
NUM_PARTIES
|
static int |
NUM_RACES
|
static int |
PARTY_DEMOCRAT
|
static int |
PARTY_GREEN
|
static int |
PARTY_INDEPENDENT
|
static int |
PARTY_LIBERTARIAN
|
static int |
PARTY_REPUBLICAN
|
static int |
PARTY_SILLY
|
int |
race
Race ( RACE_PRESIDENT , etc.) |
static int |
RACE_CONGRESS
|
static int |
RACE_DOG_CATCHER
|
static int |
RACE_GOVERNOR
|
static int |
RACE_PRESIDENT
|
static int |
RACE_SENATE
|
static int |
RACE_STATE_ASSEMBLY
|
int |
voteBlockId
Used to group votes by a single person together. |
int |
voteNum
This vote's sequence number, assigned to it by a voting booth. |
Constructor Summary | |
Vote(byte[] boothAddress,
int voteNum,
int voteBlockId,
int race,
int candidateID,
int candidateParty)
Constructor. |
Method Summary | |
static java.lang.String |
partyToString(int party)
|
static java.lang.String |
raceToString(int race)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int RACE_PRESIDENT
public static final int RACE_SENATE
public static final int RACE_CONGRESS
public static final int RACE_GOVERNOR
public static final int RACE_STATE_ASSEMBLY
public static final int RACE_DOG_CATCHER
public static final int NUM_RACES
public static final int PARTY_DEMOCRAT
public static final int PARTY_REPUBLICAN
public static final int PARTY_INDEPENDENT
public static final int PARTY_LIBERTARIAN
public static final int PARTY_GREEN
public static final int PARTY_SILLY
public static final int NUM_PARTIES
public java.lang.String key
public byte[] boothAddress
public int voteNum
public int voteBlockId
public int race
RACE_PRESIDENT
, etc.)
public int candidateID
public int candidateParty
PARTY_SILLY
, etc.)
Constructor Detail |
public Vote(byte[] boothAddress, int voteNum, int voteBlockId, int race, int candidateID, int candidateParty)
boothAddress
- the voting booth's addressvoteNum
- assigned by the voting boothvoteBlockId
- assigned by the voting boothrace
- RACE_PRESIDENT
, etc.candidateID
- candidate ID numbercandidateParty
- PARTY_SILLY
, etc.Method Detail |
public static java.lang.String raceToString(int race)
public static java.lang.String partyToString(int party)
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |