votorola.a.election
Class Count

java.lang.Object
  extended by Count
All Implemented Interfaces:
Serializable

@ThreadSafe
public final class Count
extends Object
implements Serializable

The tallied results of an election.

See Also:
Serialized Form

Constructor Summary
Count(ReadyDirectory readyDirectory, CountNode.Table.RankedCumulate rankedCumulate)
          Constructs a Count.
 
Method Summary
 long candidateCount()
          The number of nodes with a receive count of 1 or higher.
 CountNode.Table countNodeTable()
          The relational store of count nodes that (in part) backs this count.
 long holdCount()
          The total hold count for all nodes.
(package private)  void init(CountNode.Table countNodeTable)
           
 long nodeCount()
          The number of recorded nodes, corresponding to rows in the node table.
 long rankCount()
          The total number of ranks.
(package private) static Count readObjectFromMountedCountFile(ReadyDirectory readyDirectory)
           
 ReadyDirectory readyDirectory()
          The file part of the backing for this count.
 long singleCastCount()
          The total number of votes cast.
(package private)  void writeObjectToMountedCountFile()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Count

Count(ReadyDirectory readyDirectory,
      CountNode.Table.RankedCumulate rankedCumulate)
Constructs a Count.

Parameters:
readyDirectory - per readyDirectory()
Method Detail

readObjectFromMountedCountFile

static Count readObjectFromMountedCountFile(ReadyDirectory readyDirectory)
                                     throws IOException
Throws:
IOException
See Also:
writeObjectToMountedCountFile()

writeObjectToMountedCountFile

void writeObjectToMountedCountFile()
                             throws IOException
Throws:
IOException
See Also:
readObjectFromMountedCountFile(ReadyDirectory)

init

@ThreadRestricted(value="constructor")
void init(CountNode.Table countNodeTable)
See Also:
countNodeTable()

candidateCount

public long candidateCount()
The number of nodes with a receive count of 1 or higher.

See Also:
CountNode.receiveCount()

countNodeTable

public CountNode.Table countNodeTable()
The relational store of count nodes that (in part) backs this count. It is a schema.table named "election-name.date-count_node-date", stored in the count database.

Returns:
reference to relational store; or null, if the count was not initialized with a reference
See Also:
Election.countDatabase(), init(CountNode.Table)

holdCount

public long holdCount()
The total hold count for all nodes. This is identical to the number of votes cast.

See Also:
CountNode.holdCount()

nodeCount

public long nodeCount()
The number of recorded nodes, corresponding to rows in the node table. It includes eligible and ineligible voters. It might (in future) include voters who are not participating at all in the election, but have set some particular flag (such as non-cascading). This value is not meaningful, therefore, except to administrators.

See Also:
CountNode

rankCount

public long rankCount()
The total number of ranks. This is also the value of the bottom rank, that of the node(s) receiving the lowest number (normally zero) of votes.

Returns:
count of 1 or larger; or 0, if there are no nodes at all
See Also:
CountNode.getRank()

readyDirectory

public ReadyDirectory readyDirectory()
The file part of the backing for this count.


singleCastCount

public long singleCastCount()
The total number of votes cast. This is identical to the hold count.

See Also:
CountNode.singleCastCount()