Class Console

java.lang.Object
  extended by Console

public class Console
extends java.lang.Object

The administration console class - manages a list of PIN numbers that are authorized to vote. The idea is that a poll worker would have this, and would communicate valid PIN numbers to voters. PINs are validated over the network (at the moment, using a simple unencrypted protocol). When a PIN is validated, it is thrown out of the list and replaced. Any of the PINs in the list are acceptable, to deal with voters using PINs out of turn.

Author:
Dave Price

Field Summary
static int CONSOLE_PORT
          What port we listen to for connections
static int HOW_MANY_PINS
          How many PINs are valid at once
 
Constructor Summary
Console()
           
 
Method Summary
static java.lang.String intListString(java.util.List intlist)
          Returns the string representation of a List.
static void main(java.lang.String[] args)
          Main method.
static java.lang.Integer nextPIN()
          Get the next PIN
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSOLE_PORT

public static final int CONSOLE_PORT
What port we listen to for connections

See Also:
Constant Field Values

HOW_MANY_PINS

public static final int HOW_MANY_PINS
How many PINs are valid at once

See Also:
Constant Field Values
Constructor Detail

Console

public Console()
Method Detail

main

public static void main(java.lang.String[] args)
Main method. Runs the console GUI.


nextPIN

public static java.lang.Integer nextPIN()
Get the next PIN

Returns:
the next PIN

intListString

public static java.lang.String intListString(java.util.List intlist)
Returns the string representation of a List. Note that the code never actually verifies that the input is a list of integers, so more precisely, this function takes a list and returns a string containing the item.toString()s of each item on separate lines.

Parameters:
intlist - A List of Integers
Returns:
a String with the string representation of each integer on a new line