jimm.evote
Class Vote

java.lang.Object
  extended byjimm.evote.Vote

public class Vote
extends java.lang.Object

A vote stored by a booth.

Instead of writing accessor methods, I've made the ivars public. Votes 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

RACE_PRESIDENT

public static final int RACE_PRESIDENT
See Also:
Constant Field Values

RACE_SENATE

public static final int RACE_SENATE
See Also:
Constant Field Values

RACE_CONGRESS

public static final int RACE_CONGRESS
See Also:
Constant Field Values

RACE_GOVERNOR

public static final int RACE_GOVERNOR
See Also:
Constant Field Values

RACE_STATE_ASSEMBLY

public static final int RACE_STATE_ASSEMBLY
See Also:
Constant Field Values

RACE_DOG_CATCHER

public static final int RACE_DOG_CATCHER
See Also:
Constant Field Values

NUM_RACES

public static final int NUM_RACES
See Also:
Constant Field Values

PARTY_DEMOCRAT

public static final int PARTY_DEMOCRAT
See Also:
Constant Field Values

PARTY_REPUBLICAN

public static final int PARTY_REPUBLICAN
See Also:
Constant Field Values

PARTY_INDEPENDENT

public static final int PARTY_INDEPENDENT
See Also:
Constant Field Values

PARTY_LIBERTARIAN

public static final int PARTY_LIBERTARIAN
See Also:
Constant Field Values

PARTY_GREEN

public static final int PARTY_GREEN
See Also:
Constant Field Values

PARTY_SILLY

public static final int PARTY_SILLY
See Also:
Constant Field Values

NUM_PARTIES

public static final int NUM_PARTIES
See Also:
Constant Field Values

key

public java.lang.String key
Primary key.


boothAddress

public byte[] boothAddress
Booth IP address. Foreign key, so to speak.


voteNum

public int voteNum
This vote's sequence number, assigned to it by a voting booth. Not globally unique, but unique within a voting booth.


voteBlockId

public int voteBlockId
Used to group votes by a single person together. This way, we can report on how many voters voted a straight party ticket, for example.


race

public int race
Race (RACE_PRESIDENT, etc.)


candidateID

public int candidateID
Candidate ID number.


candidateParty

public int candidateParty
Identifies the candidate's party (PARTY_SILLY, etc.)

Constructor Detail

Vote

public Vote(byte[] boothAddress,
            int voteNum,
            int voteBlockId,
            int race,
            int candidateID,
            int candidateParty)
Constructor.

Parameters:
boothAddress - the voting booth's address
voteNum - assigned by the voting booth
voteBlockId - assigned by the voting booth
race - RACE_PRESIDENT, etc.
candidateID - candidate ID number
candidateParty - PARTY_SILLY, etc.
Method Detail

raceToString

public static java.lang.String raceToString(int race)

partyToString

public static java.lang.String partyToString(int party)

toString

public java.lang.String toString()


Copyright (c) 2004 by Jim Menard jimm@io.com