votorola.a.election
Class Election.ConfigurationContext

java.lang.Object
  extended by Election.ConfigurationContext
Enclosing class:
Election

@ThreadSafe
public static final class Election.ConfigurationContext
extends Object

A context for configuring an election. Each election is configured by its configuration file, which contains a script (s) for that purpose. During construction of the election, an instance of this context (electionCC) is passed to s, via s::configureElection(electionCC).


Method Summary
 ElectoralSubserver.DatabaseCC countDatabase()
          The context for configuring the election's count database.
 String getDistrictConfigurationPath()
           
 long getElectorateSize()
           
 String getElectorateSizeExplanation()
           
 String getEligibilityScriptPath()
           
 String getShortTitle()
           
 String getSummaryDescription()
           
 String getTitle()
           
 String name()
           
 void setDistrictConfigurationPath(String districtConfigurationPath)
          Sets the path to the configuration file of this election's district.
 void setElectorateSize(long electorateSize)
          Sets the estimated size of the electorate.
 void setElectorateSizeExplanation(String electorateSizeExplanation)
          Sets the electorate size explanation.
 void setEligibilityScriptPath(String eligibilityScriptPath)
          Sets the path to the eligibility script for the election.
 void setShortTitle(String shortTitle)
          Sets the short title of the district.
 void setSummaryDescription(String summaryDescription)
          Sets the summary description of the election.
 void setTitle(String title)
          Sets the title of the election.
 ElectoralSubserver.DatabaseCC voterInputDatabase()
          The context for configuring the database of the election's voter input table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

countDatabase

public ElectoralSubserver.DatabaseCC countDatabase()
The context for configuring the election's count database.


getDistrictConfigurationPath

public String getDistrictConfigurationPath()
See Also:
RegionalElectionNode.district(), setDistrictConfigurationPath(String)

setDistrictConfigurationPath

@ThreadRestricted(value="constructor")
public void setDistrictConfigurationPath(String districtConfigurationPath)
Sets the path to the configuration file of this election's district. It must be absolute, and must not contain any shell variable, or tilde ~. The default value is votorolaDirectory/district.js.

See Also:
District.configurationFile(), RegionalElectionNode.district()

getElectorateSize

public long getElectorateSize()
See Also:
Election.electorateSize(), setElectorateSize(long)

setElectorateSize

@ThreadRestricted(value="constructor")
public void setElectorateSize(long electorateSize)
Sets the estimated size of the electorate. The default value is zero, meaning unknown.

See Also:
Election.electorateSize()

getElectorateSizeExplanation

public String getElectorateSizeExplanation()
See Also:
Election.electorateSizeExplanation(), setElectorateSizeExplanation(String)

setElectorateSizeExplanation

@ThreadRestricted(value="constructor")
public void setElectorateSizeExplanation(String electorateSizeExplanation)
Sets the electorate size explanation. The default value is "number of potential voters".

See Also:
Election.electorateSizeExplanation()

getEligibilityScriptPath

public String getEligibilityScriptPath()
See Also:
Election.eligibilityScript(), setEligibilityScriptPath(String)

setEligibilityScriptPath

@ThreadRestricted(value="constructor")
public void setEligibilityScriptPath(String eligibilityScriptPath)
Sets the path to the eligibility script for the election. It must be absolute, and must not contain any shell variable, or tilde ~. The default value is votorolaDirectory/eligibility.js.

See Also:
Election.eligibilityScript()

getShortTitle

public String getShortTitle()
See Also:
District.shortTitle(), setShortTitle(String)

setShortTitle

@ThreadRestricted(value="constructor")
public void setShortTitle(String shortTitle)
Sets the short title of the district. The default value is the election's name, with the first character converted to upper case.

See Also:
District.shortTitle()

getSummaryDescription

public String getSummaryDescription()
See Also:
Election.summaryDescription(), setSummaryDescription(String)

setSummaryDescription

@ThreadRestricted(value="constructor")
public void setSummaryDescription(String summaryDescription)
Sets the summary description of the election. The default value is a placeholder with configuration instructions for the administrator.

Throws:
IllegalArgumentException - if the description contains any newline characters, because they might render inconsistently across different types of user interface
See Also:
Election.summaryDescription()

getTitle

public String getTitle()
See Also:
Election.title(), setTitle(String)

setTitle

@ThreadRestricted(value="constructor")
public void setTitle(String title)
Sets the title of the election. The default value is the short title.

See Also:
RegionalElectionNode.shortTitle(), Election.title()

name

public String name()
See Also:
ElectoralService.name()

voterInputDatabase

public ElectoralSubserver.DatabaseCC voterInputDatabase()
The context for configuring the database of the election's voter input table. At runtime, a table named service-name is created in this database, if it does not already exist.