jimm.evote
Class Booth

java.lang.Object
  extended byjimm.evote.Booth

public class Booth
extends java.lang.Object

A voting booth.

Instead of writing accessor methods, I've made the ivars public. Booths are essentially simple data structures.


Field Summary
 byte[] address
          The voting booth's identifier is its IP address.
 java.lang.String city
          City name.
 java.lang.String district
          District name.
 java.lang.String state
          The two-letter abbreviation of the US state this booth is in.
 java.util.List votes
          Votes.
 
Constructor Summary
Booth(byte[] address, java.lang.String state, java.lang.String city, java.lang.String district)
           
 
Method Summary
 void generateAndSendVotesTo(VoteServer server)
          Generates simulated votes and sends them to server.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

address

public byte[] address
The voting booth's identifier is its IP address.


state

public java.lang.String state
The two-letter abbreviation of the US state this booth is in.


city

public java.lang.String city
City name.


district

public java.lang.String district
District name.


votes

public java.util.List votes
Votes.

Constructor Detail

Booth

public Booth(byte[] address,
             java.lang.String state,
             java.lang.String city,
             java.lang.String district)
Method Detail

generateAndSendVotesTo

public void generateAndSendVotesTo(VoteServer server)
Generates simulated votes and sends them to server. We decide randomly which races to vote in.

Parameters:
server - a vote server

toString

public java.lang.String toString()


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