software.authoring
Class ContestSymbols

java.lang.Object
  extended by software.authoring.ContestSymbols
Direct Known Subclasses:
ContestSymbols

public class ContestSymbols
extends java.lang.Object

Permutes the symbols as they should appear on each ballot. Given the prints file (produced by m2), and the serial number of a ballot it produces the entire set of permuted symbols in the order they appear on a ballot (both top and bottom pages)

Author:
stefan

Constructor Summary
ContestSymbols(java.lang.String pathToPrintsFile, org.gwu.voting.standardFormat.electionSpecification.ElectionSpecification es, char[] chars, boolean charReset)
           
ContestSymbols(java.lang.String pathToPrintsFile, java.lang.String pathToElectionSpec, char[] chars, boolean charReset)
           
 
Method Summary
 java.lang.String getAllSymbols(int r, int page)
          returns all the symbols (permuted for each contest) for serial number r and the given page
 java.lang.String getCanonicalSymbols()
           
 java.lang.String getSerialNumber(int r)
           
static void main(java.lang.String[] args)
          Debug method
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContestSymbols

public ContestSymbols(java.lang.String pathToPrintsFile,
                      java.lang.String pathToElectionSpec,
                      char[] chars,
                      boolean charReset)
               throws java.lang.Exception
Parameters:
pathToPrintsFile - - path to the files produced in meting 2, specifiyng the permutation on each ballot
pathToElectionSpec - - path to a file containing the ElectionSpec
chars - - The charachters to be permuted (that appear on the ballot) There is either one carachter and that is "A" or "a" or "0", or there are at least as many charachters as the biggest contest.
charReset - - true if every contest should start from the first charachter, false if the first character of a contest is the next character in the array.
Throws:
java.lang.Exception

ContestSymbols

public ContestSymbols(java.lang.String pathToPrintsFile,
                      org.gwu.voting.standardFormat.electionSpecification.ElectionSpecification es,
                      char[] chars,
                      boolean charReset)
               throws java.lang.Exception
Parameters:
pathToPrintsFile - - path to the files produced in meting 2, specifiyng the permutation on each ballot
es - - the ELection Specification
chars - - The charachters to be permuted (that appear on the ballot) There is either one carachter and that is "A" or "a" or "0", or there are at least as many charachters as the biggest contest.
charReset - - true if every contest should start from the first charachter, false if the first character of a contest is the next character in the array.
Throws:
java.lang.Exception
Method Detail

getSerialNumber

public java.lang.String getSerialNumber(int r)
Parameters:
r - - the row number in the prints file
Returns:
- the serial number of row number r in the prints file

getAllSymbols

public java.lang.String getAllSymbols(int r,
                                      int page)
returns all the symbols (permuted for each contest) for serial number r and the given page

Parameters:
r - - the row number in the prints table
page - - 0 or 1 corresponding to bottom or top
Returns:
a String of permuted characters (per contest)

getCanonicalSymbols

public java.lang.String getCanonicalSymbols()
Returns:
- the symbols on the canonical ballot

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Debug method

Parameters:
args -
Throws:
java.lang.Exception